A. Student s ; B. Student s = new Student(); C. Student s = new student(); D. Student s = s.student();
举一反三
- 声明并创建一个学生类Student的对象s,下列语法格式正确的是: A: Student s = Student(); B: Student s; C: Student s = new Student(); D: Student s = new ();
- Student类是Person类的子类,分析下面语句,转型是否正确: Student s =(Student)new Person("张三", 23);
- This is ____ reading-room. A: the student's B: student's C: the students' D: students'
- 假设student类定义了Name,ClassInfor,StuNumber,利用对象初始化器student类的一个对象并初始化它的属性,下面写法正确的是() A: student s1 =new student{Name=”ZhangSan”, ClassInfor =”IT201801”, StuNumber =”10000001”}; B: student s2 =new student{ ClassInfor =”IT201801”, Name=”ZhangSan”, StuNumber =”10000001”}; C: student s3 =new student{StuNumber =”10000001”}; D: 以上写法均正确
- 假设student类定义了Name,ClassInfor,StuNumber三个属性,利用对象初始化器来初始化student类的一个对象,下面写法正确的是( ) A: student s1 =new student{Name=”ZhangSan”, ClassInfor =”IT201801”, StuNumber =”10000001”}; B: student s2 =new student{ ClassInfor =”IT201801”, Name=”ZhangSan”, StuNumber =”10000001”}; C: student s3 =new student{StuNumber =”10000001”}; D: 其它三种写法均正确
内容
- 0
【单选题】类Teacher和Student是类Person的子类; Person p; Teacher t; Student s; //p, t and s 非空 if(t instanceof Person) { s = (Student)t; } 最后一条语句的结果说法正确是()。 A. 将构造一个Student对象 B. 表达式是合法的 C. 表达式是错误的 D. 编译时正确,但运行时错误
- 1
以下变量定义,错误的是: A: struct student{int num, char name[20];} s; B: struct {int num, char name[20];} s; C: struct student{int num, char name[20];}; struct student s; D: struct student{int num, char name[20];} ; student s
- 2
Conversation 7~11:Listen to part of a conversation between a studentand a professor. What do the student and the professor mostly discuss A: The student’s need to attend class B: The student’s potential grade in class C: The student’s stay in the hospital D: The student’s absence from class
- 3
This book isthat ______. A: the student B: the student’s C: the students’
- 4
定义一个学生类Student,则初始化一个学生对象的语句是( )