网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下述代码执行后,可以被垃圾收集器收集的对象是哪一个() Student stua; stua = new Student(“Mike”); Student stub; stub = stua; stua = new Student(“Jack”);
- A、Student(“Mike”)
- B、stua
- C、stub
- D、以上都不是
参考答案
更多 “ 下述代码执行后,可以被垃圾收集器收集的对象是哪一个() Student stua; stua = new Student(“Mike”); Student stub; stub = stua; stua = new Student(“Jack”); A、Student(“Mike”)B、stuaC、stubD、以上都不是” 相关考题
考题
The new _____library has been set up.Do you know how big it is?
A.student’sB.students’C.studentsD.student’
考题
阅读以下说明和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;}}
考题
下述代码执行后,可以被垃圾收集器收集的对象是哪一个()Studentstua;stua=newStudent(Mike”);Studentstub;stub=stua;stua=newStudent(Jack”);
A.Student(“Mike”)B.stuaC.stubD.以上都不是
考题
下述代码执行后,有几个引用变量和几个对象?()Studentstu=newStudent(“Mike”);Studentstua;Stua=stu;
A.2个引用变量,1个对象B.1个引用变量,1个对象C.2个引用变量,2个对象D.1个引用变量,2个对象
考题
Which statement explicitly names a constraint? ()
A. ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students (student_id);B. ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);C. ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);D. ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);E. ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
考题
下列对$student使用正确的是()。
A.$student-$getName();B.$student-name;C.$student-$name;D.$student.getName();
考题
Student A: I am terribly sorry because I left your dictionary in the library and I just couldn't find it there.Student B:______I have a new one.
考题
Student A: I wonder whether you are satisfied with the new equipment.Student B: ______. It gives me a lot of trouble.
考题
类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个对象
考题
预测以下代码片段的输出结果:() var student = new Object( ); student.study = function( ) {window.alert(“开始学习了”); } study( );A、输出“开始学习了”B、程序出错。不能在实例化对象之后,再添加方法C、程序出错。study()方法不能直接调用。应该用student来调用D、程序出错。给student.study赋值时,右边的函数必须有名字
考题
下述代码执行后,有几个引用变量和几个对象?() Student stu = new Student(“Mike”); Student stua; Stua = stu; A、 2个引用变量,1个对象B、 1个引用变量,1个对象C、 2个引用变量,2个对象D、 1个引用变量,2个对象
考题
类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(“数学”);
考题
对于如下代码,描述正确的是哪项?() 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代码如下:D class Student{ String name; int age; Student(String nm){ (构造方法) name = nm; } } 执行语句Student stu = new Student()后,字段age的值是哪项?()A、 0B、 nullC、 falseD、 编译错误
考题
Which statement explicitly names a constraint?()A、ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students(student_id);B、ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students(student_id);C、ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students(student_id);D、ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students(student_id);E、ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students(student_id);
考题
单选题下述代码执行后,有几个引用变量和几个对象?() 对象声明Student stu(对象)= new Student(“Mike”); 对象定义(开辟空间) Student stua;(声明变量) Stua = stu;A
2个引用变量,1个对象B
1个引用变量,1个对象C
2个引用变量,2个对象D
1个引用变量,2个对象
考题
单选题下述代码执行后,有几个引用变量和几个对象?() Student stu = new Student(“Mike”); Student stua; Stua = stu;A
2个引用变量,1个对象B
1个引用变量,1个对象C
2个引用变量,2个对象D
1个引用变量,2个对象
考题
多选题对于如下代码,描述正确的是哪项?() 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 stua; stua = new Student(“Mike”); Student stub; stub = stua; stua = new Student(“Jack”);A
Student(“Mike”)B
stuaC
stubD
以上都不是
考题
多选题对于如下代码,描述正确的是哪项? () class Student{ public static void main(String[] args){ Student student = new Student(); } }AStudent student 声明了一个类Bnew Student()创建了Student 对象的一个实例CStudent student 声明了对象Student 的一个引用Dclass Student 声明了一个类
考题
单选题Which statement explicitly names a constraint?()A
ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students(student_id);B
ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students(student_id);C
ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students(student_id);D
ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students(student_id);E
ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students(student_id);
考题
单选题类Student代码如下:D class Student{ String name; int age; Student(String nm){ (构造方法) name = nm; } } 执行语句Student stu = new Student()后,字段age的值是哪项?()A
0B
nullC
falseD
编译错误
考题
单选题类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(“数学”);
热门标签
最新试卷