网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
类Student的声明如下:   package com.school class Student{ String name;  int age;  Student(String name,int age){  //code } void study(String subject){ / /code } }  正确调用方法study(String subject)的是哪项?()
A

Student stu = new Student(“Tom”,23); stu.study(“数学”);

B

Student.study(“数学”);

C

Student stu = new Student(“Tom”,23); stu.study();

D

Student stu = new Student(“Tom”,23); String result=stu.study(“数学”);


参考答案

参考解析
解析: 暂无解析
更多 “单选题类Student的声明如下:   package com.school class Student{ String name;  int age;  Student(String name,int age){  //code } void study(String subject){ / /code } }  正确调用方法study(String subject)的是哪项?()A Student stu = new Student(“Tom”,23); stu.study(“数学”);B Student.study(“数学”);C Student stu = new Student(“Tom”,23); stu.study();D Student stu = new Student(“Tom”,23); String result=stu.study(“数学”);” 相关考题
考题 阅读以下说明和java代码,将应填入(n)处的字句写在对应栏内。[说明]有若干教师,每个教师只有姓名,一个教师可以指导多名研究生;每名研究生有姓名和研究方向,程序最后输出每个教师指导的所有研究生的姓名和研究方向。[Java程序]public class Teacher {String name;int top=0;Student[] student=new Student[20];public Teacher() {}public Teacher(String name) { this.name=name;}boolean add(Student stu){int len=this.student.length;if (top<len-1) {this.student[top]=siu;(1);return true;}elsereturn (2);}void disp(){System.out.println(“指导老师"”+this.name);System.out.println(“研究生:”);for(int i=0;i<(3);i++){System.out.println(“姓名:”+this.student[i].name+“\t研究方向:”+this.student[i]. search);}}public static void main(String[] args){Teacher t[]={new Teacher(“李明”),new Teacher(“王华”)};Student s1 = new Student(“孙强”,“数据库”);Student s2 = new Student(“陈文”,“软件工程”);Student s3 = new Student(“章锐”,“计算机网络”);if(! t[0].add(s1)) {System.out.println(“每个老师最多只能指导20个学生!”);}if(! t[0].add(a2)) {System.out.println(“每个老师最多只能指导20个学生!”);}if(! t[1].add(s3)) {System.out.println(“每个老师最多只能指导20个学生!”);}for(int i=0;i<2;i++)(4);}}class (5) {String name;String search;public Student(){}public Student(String name,String search){this.name=name;this.search=search;}String getName(){return this.name;}String getSearch(){return this.search;}}

考题 ( 30 )下列代码声明了 3 个类class Person{};class Student:public Person{};class Undergraduate:Student{};下列关于这些类之间关系的描述中,错误的是A )类 Person 是类 Undergraduate 的基类B )类 Undergraduate 从类 Student 公有继承C )类 Student 是类 Person 的派生类D )类 Undergraduate 是类 Person 的派生类

考题 设有如下的用户定义类型: Type Student number As String name As string age As Integer End Type 则以下正确引用该类型成员的代码是______。A. Student name="李明”B.Dim s As Student s.name="李明"C.Dim s As Type Student s.name="李明"D.Dim s As Type s.name="李明"

考题 下列代码段声明了3个类:class Person();class Student:public Person{};class Undergraduate:Student{};下列关于这些类之间关系的描述中,错误的是( )。A.类Person是类Undergraduate的基类B.类Undergraduate从类Student公有继承C.类Student是类Person的派生类D.类Undergraduate是类Person的派生类

考题 对于如下代码,描述正确的是哪项?()classStudent{publicstaticvoidmain(String[]args){Studentstudent=newStudent();}} A.newStudent()创建了Student对象的一个实例B.Studentstudent声明了对象Student的一个引用C.classStudent声明了一个类D.newStudent()创建了一个类E.Studentstudent声明了一个类

考题 对于如下代码,描述正确的是哪项?()classStudent{publicstaticvoidmain(String[]args){Studentstudent=newStudent();}} A.Studentstudent声明了一个类B.newStudent()创建了Student对象的一个实例C.Studentstudent声明了对象Student的一个引用D.classStudent声明了一个类

考题 创建一个名为student的新类,保存新类的类库名称是mylib,新类的父类是Person,正确的命令是A.CREATE CLASS mylib OF student As PemonB.CREATE CLASS student OF Pe~on As mylibC.CREATE CLASS student 0F mylib As Pe~onD.CREATE CLASS Person OF mylib As student

考题 设有下面两个类的定义: class Person{ long id // 身份证号 String name; //姓名 } class Student extends Person{ int score: //成绩 int getScore ( ) { return score; } } 则类Person和类Student的关系是( )。A.包含关系B.继承关系C.关联关系D.无关系

考题 阅读以下说明和Java 码,将应填入(n)处的字名写在的对应栏内。[说明] 编写一个学生类Student,要求:(1) 学生类Student 属性有:id: long 型,代表学号name: String类对象,代表姓名age: int 型,代表年龄sex: boolen 型,代表性别(其中:true 表示男,false 表示女)phone: String 类对象,代表联系电话(2) 学生类Student 的方法有:Student (long i,String n,int a,boolean s,String p):有参构造函数,形参表中的参数分别初始化学号、姓名、年龄、性别和联系电话。int getAge ():获取年龄作为方法的返回值。boolean getSex ():获取性别作为方法的返回值。String getPhone ():获取联系电话作为方法的返回值。public String to String ():以姓名:性别:学号:联系电话的形式作为方法的返import java. applet. Applet;import java. awt.* ;public class Student extends Applet {long id;String name, phone;int age;boolean sex;Student(long i, String n, int a, boolean s, String p){id=i;name = n;age = a;sex= s;phone = p;{public void paint( Graphics g){Student x= new Student (5000," xiaoliu" , 89, true, " 8989898" );(1);(2)g. drawstring( x. getPhone( ), 140,140);}int getAge( ){ return age; }boolean getsex ( ){ return sex; }String getPhone( ){ return phone; }String ToString( ){(3)}}

考题 创建一个名为student的新类,保存新类的类库名称是mylib,新类的父类名是Person,正确的命令是( )。A.CREATE CLASS mylib OF student AS PcrsonB.CREATE CLASS student OF Person AS mylibC.CREATE CLASS student OF mylib AS PersonD.CREATE CLASS Person OF mylib AS student

考题 要求:1. 按如下类图写出相应数据库建表 sql 脚本。 其中 Student 和 Score 是1 对多的关系,Scroe 和 Course是多对 1 的关系。Student-id: String-name: String-birthday: Date-address: String-phone: String-email: StringScore-student: Student-course: Course-grade: floatCourse-id: String-name: String-description: String

考题 设有如下的记录类型: Type Student number As String name As String age As Integer End Type 则正确引用该记录类型变量的代码是______。A.StUdent.name=""B.Dim s As StUdent s.name="张红"C.Dim s As Type Student s.name="张红"D.Dim s As Type s.name="张红"

考题 设有下面两个类的定义。 class Person { long id; // 身份证号 String name; // 姓名 } class Student extends Person { int score; // 入学总分 } intgetScore() { return score;} } 则类Person和类Student的关系是? } A.包含关系B.继承关系C.关联关系D.上述类定义有语法错误

考题 类Student代码如下:  class Student{    String name;  int age;  Student(String nm){  name = nm; } }  执行语句Student stu = new Student()后,字段age的值是哪项?() A、 0B、 nullC、 falseD、 编译错误

考题 关于语句package com.myschool,叙述错误的是哪一项?()A、该语句必须出现在类声明语句中class Student{}之前B、包名com.myschool对应目录结构com/myschoolC、要想引入该包中的所有类,必须使用import com.myschoolD、任何类中都必须包括package语句

考题 类Student的声明如下:   package com.school class Student{ String name;  int age;  Student(String name,int age){  //code } void study(String subject){ / /code } }  正确调用方法study(String subject)的是哪项?() A、Student stu = new Student(“Tom”,23); stu.study(“数学”);B、Student.study(“数学”);C、Student stu = new Student(“Tom”,23); stu.study();D、Student stu = new Student(“Tom”,23); String result=stu.study(“数学”);

考题 下列有关类声明的代码片段,哪一项是正确的?() A、 import java.sql.*; package school; class Student{ }B、 package school; import java.sql.*; class Student{ }C、 package school; class Student{ } import java.sql.*;D、 package school; import java.sql.*;private String name; class Student{ }

考题 类 Student 中字段mark的缺省值是哪项?()   Class Student{   String name;   int age;   float market;   ·········   }  A、0.0fB、numllC、falseD、0E、0.0

考题 对于如下代码,描述正确的是哪项?()  class Student{   public static void main(String[] args){   Student student=new Student();  }  }  A、new Student()创建了Student对象的一个实例B、Student student声明了对象Student的一个引用C、class Student声明了一个类D、new Student()创建了一个类E、Student student 声明了一个类

考题 对于如下代码,描述正确的是哪项? ()   class Student{   public static void main(String[] args){   Student student = new Student();  }  }  A、Student student 声明了一个类B、new Student()创建了Student 对象的一个实例C、Student student 声明了对象Student 的一个引用D、class Student 声明了一个类

考题 在类Acoount中,正确引入类school.Student的语句是哪一项?()  A、import schoolB、import schllo.*C、package school.StudentD、import Student

考题 单选题类Student代码如下:  class Student{    String name;  int age;  Student(String nm){  name = nm; } }  执行语句Student stu = new Student()后,字段age的值是哪项?()A  0B  nullC  falseD  编译错误

考题 多选题对于如下代码,描述正确的是哪项? ()   class Student{   public static void main(String[] args){   Student student = new Student();  }  }AStudent student 声明了一个类Bnew Student()创建了Student 对象的一个实例CStudent student 声明了对象Student 的一个引用Dclass Student 声明了一个类

考题 单选题创建一个名为student的新类,保存新类的类库名称是mylib,新类的父类是Person,正确的命令是(  )。A CREATE CLASS mylib OF student As PersonB CREATE CLASS student OF Person As mylibC CREATE CLASS student OF mylib As PersonD CREATE CLASS Person OF mylib As student

考题 单选题下列有关类声明的代码片段,哪一项是正确的?()A  import java.sql.*; package school; class Student{ }B  package school; import java.sql.*; class Student{ }C  package school; class Student{ } import java.sql.*;D  package school; import java.sql.*;private String name; class Student{ }

考题 单选题类Student代码如下:D   class Student{   String name;   int age;   Student(String nm){ (构造方法)   name = nm;  }  }   执行语句Student stu = new Student()后,字段age的值是哪项?()A  0B  nullC  falseD  编译错误

考题 多选题对于如下代码,描述正确的是哪项?()  class Student{   public static void main(String[] args){   Student student=new Student();  }  }Anew Student()创建了Student对象的一个实例BStudent student声明了对象Student的一个引用Cclass Student声明了一个类Dnew Student()创建了一个类EStudent student 声明了一个类

考题 单选题类Student的声明如下:   package com.school class Student{ String name;  int age;  Student(String name,int age){  //code } void study(String subject){ / /code } }  正确调用方法study(String subject)的是哪项?()A Student stu = new Student(“Tom”,23); stu.study(“数学”);B Student.study(“数学”);C Student stu = new Student(“Tom”,23); stu.study();D Student stu = new Student(“Tom”,23); String result=stu.study(“数学”);