單項(xiàng)選擇題

類(lèi)Student的聲明如下:  
package com.school class Student{ String name; 
int age; 
Student(String name,int age){ 
//code } void study(String subject){ /
/code } } 
正確調(diào)用方法study(String subject)的是哪項(xiàng)?() 

A.Student stu = new Student(“Tom”,23); stu.study(“數(shù)學(xué)”);
B.Student.study(“數(shù)學(xué)”);
C.Student stu = new Student(“Tom”,23); stu.study();
D.Student stu = new Student(“Tom”,23); String result=stu.study(“數(shù)學(xué)”);

微信掃碼免費(fèi)搜題