填空题
3. string foo = “ABCDE”;
4. foo.substring(3);
5. foo.concat(“XYZ”);
6.
Type the value of foo at line 6.()
【参考答案】
ABCDE
点击查看答案
相关考题
-
单项选择题
1. public class X ( 2. public object m () { 3. object o = new float (3.14F); 4. object [] oa = new object [1]; 5. oa[0]= o; 6. o = null; 7. return oa[0]; 8. } 9. } When is the float object created in line 3, eligible for garbage collection?()
A. Just after line 5
B. Just after line 6
C. Just after line 7 (that is, as the method returns)
D. Never in this method. -
单项选择题
1. public class returnIt ( 2. returnType methodA(byte x, double y) ( 3. return (short) x/y * 2; 4. ) 5. ) What is the valid returnType for methodA in line 2?()
A. Int
B. Byte
C. Long
D. Short
E. Float
F. Double -
单项选择题
class super ( public int I = 0; public super (string text) ( I = 1 ) ) public class sub extends super ( public sub (string text) ( i= 2 ) public static void main (straing args[]) ( sub sub = new sub (“Hello”); system.out. PrintIn(sub.i); ) ) What is the result?()
A. Compilation will fail.
B. Compilation will succeed and the program will print “0”
C. Compilation will succeed and the program will print “1”
D. Compilation will succeed and the program will print “2”
