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

题目内容 (请给出正确答案)

类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(“数学”);” 相关考题
考题 ( 30 )下列代码声明了 3 个类class Person{};class Student:public Person{};class Undergraduate:Student{};下列关于这些类之间关系的描述中,错误的是A )类 Person 是类 Undergraduate 的基类B )类 Undergraduate 从类 Student 公有继承C )类 Student 是类 Person 的派生类D )类 Undergraduate 是类 Person 的派生类

考题 下列代码段声明了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的声明如下:packagecom.schoolclassStudent{Stringname;intage;Student(Stringname,intage){//code}voidstudy(Stringsubject){//code}}正确调用方法study(Stringsubject)的是哪项?() A.Studentstu=newStudent(“Tom”,23);stu.study(“数学”);B.Student.study(“数学”);C.Studentstu=newStudent(“Tom”,23);stu.study();D.Studentstu=newStudent(“Tom”,23);Stringresult=stu.study(“数学”);

考题 类Student代码如下:DclassStudent{Stringname;intage;Student(Stringnm){(构造方法)name=nm;}}执行语句Studentstu=newStudent()后,字段age的值是哪项?() A.0B.nullC.falseD.编译错误

考题 类Student代码如下:classStudent{Stringname;intage;Student(Stringnm){name=nm;}}执行语句Studentstu=newStudent()后,字段age的值是哪项?() A.0B.nullC.falseD.编译错误

考题 若把学生看成一个实体,它可以分成多个子实体,如小学生、中学生和大学生等。在面向对象的设计中,可以创建如下4个类:类Student、类Elementary Student、Middle Student;类University Student。试给出这4个类的属性以及它们之间的关系。

考题 创建一个名为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

考题 创建一个名为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

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

考题 定义一个表示学生信息的类Student,要求如下:

考题 声明语句<!ATTIBLIST student studentID ID #REQUIRED>的作用是()A、声明元素student的属性studentID是可有可无的B、声明元素student的属性studentID是唯一标识类型,可以省略C、声明元素student的属性studentID是默认取值,可以省略D、声明元素student的属性studentID是唯一标识类型,不可省略

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

考题 下述代码执行后,有几个引用变量和几个对象?() 对象声明Student stu(对象)= new Student(“Mike”);  对象定义(开辟空间)   Student stua;(声明变量)   Stua = stu;  A、 2个引用变量,1个对象B、 1个引用变量,1个对象C、 2个引用变量,2个对象D、 1个引用变量,2个对象

考题 下列有关类声明的代码片段,哪一项是正确的?() 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{ }

考题 对于如下代码,描述正确的是哪项?()  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 声明了一个类

考题 单选题类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

考题 单选题下述代码执行后,有几个引用变量和几个对象?() 对象声明Student stu(对象)= new Student(“Mike”);  对象定义(开辟空间)   Student stua;(声明变量)   Stua = stu;A  2个引用变量,1个对象B  1个引用变量,1个对象C  2个引用变量,2个对象D  1个引用变量,2个对象

考题 问答题若把学生看成一个实体,它可以分成多个子实体,如小学生、中学生和大学生等。在面向对象的设计中,可以创建如下4个类:类Student、类Elementary Student、Middle Student;类University Student。试给出这4个类的属性以及它们之间的关系。

考题 单选题下列有关类声明的代码片段,哪一项是正确的?()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(“数学”);