单项选择题
11.rbo = new ReallyBigObject();
12.//more code here
13.rbo = null;
14./*insert code here*/
Which statement should be placed at line 14 to suggest that the virtual machine expend effort toward recycling the memory used by the objectrbo?()
A.System.gc();
B.Runtime.gc();
C.System.freeMemory();
D.Runtime.getRuntime().growHeap();
E.Runtime.getRuntime().freeMemory();
相关考题
-
单项选择题
package test; class Target{ public String name="hello"; } What can directly access and change the value of the variable name?()
A.any class
B.only the Target class
C.any class in the test package
D.any class that extends Target -
单项选择题
Given a class Repetition: 1.package utils; 2. 3.public class Repetition{ 4.public static String twice(Strings){returns+s;} 5.} and given another class Demo: 1.//insert code here2. 3.public class Demo{ 4.public static void main(String[]args){ 5.System.out.println(twice("pizza")); 6.} 7.} Which code should be inserted at line 1 of Demo.java to compile and run Demo to print“pizzapizza”?()
A.import utils.*;
B.static import utils.*;
C.importutils.Repetition.*;
D.static importutils.Repetition.*;
E.import utils.Repetition.twice();
F.import static utils.Repetition.twice;
G.static import utils.Repetition.twice; -
单项选择题
Given classes defined in two different files: 1.package util; 2.public class BitUtils{ 3.private static void process(byte[]b){} 4.} 1.package app; 2.public class SomeApp{ 3.public static void main(String[]args){ 4.byte[]bytes=newbyte[256]; 5.//insert code here 6.} 7.} What is required at line 5 in class SomeApp to use the process method of BitUtils?()
A.process(bytes);
B.BitUtils.process(bytes);
C.app.BitUtils.process(bytes);
D.util.BitUtils.process(bytes);
E.importutil.BitUtils.*;process(bytes);
F.SomeApp cannot use the process method in BitUtils.
