单项选择题
类Student代码如下: class Student{ String name; int age; Student(String nm){ name = nm; } } 执行语句Student stu = new Student()后,字段age的值是哪项?()
A. 0 B. null C. false D. 编译错误
下列关于Java对象清除的叙述正确的是哪项?()A. 对象被创建后,立刻变成垃圾对象B. 任何不再被引用的对象...
单项选择题下列关于Java对象清除的叙述正确的是哪项?()
A. 对象被创建后,立刻变成垃圾对象 B. 任何不再被引用的对象都是垃圾收集的对象 C. 一旦对象失去引用,垃圾收集器立刻把它从内存中清除 D. Java对象的清除必须自己手动处理
下述代码执行后,有几个引用变量和几个对象?() Student stu = new Student(“Mi...
下述代码执行后,有几个引用变量和几个对象?() Student stu = new Student(“Mike”); Student stua; Stua = stu;
A. 2个引用变量,1个对象 B. 1个引用变量,1个对象 C. 2个引用变量,2个对象 D. 1个引用变量,2个对象
现有: class TestFoo { int x; String y; int getX()...
现有: class TestFoo { int x; String y; int getX() { return x; } String getY() { return y; } void setX(int x) { int z = 7; this.x = x; } } 可以添加多少个修饰符来封装此类?()
A. 2 B. 3 C. 4 D. 5