A. 對象被創(chuàng)建后,立刻變成垃圾對象 B. 任何不再被引用的對象都是垃圾收集的對象 C. 一旦對象失去引用,垃圾收集器立刻把它從內(nèi)存中清除 D. Java對象的清除必須自己手動處理
下述代碼執(zhí)行后,有幾個引用變量和幾個對象?() Student stu = new Student(“Mike”); Student stua; Stua = stu;
A. 2個引用變量,1個對象 B. 1個引用變量,1個對象 C. 2個引用變量,2個對象 D. 1個引用變量,2個對象
現(xiàn)有: 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