A. public interface Person { } public class Employee extends Person { }
B. public interface Shape { } public class Employee extends Shape { }
C. public interface Color { } public class Employee extends Color { }
D. public class Species { } public class Animal (private Species species;)
E. interface Component { } Class Container implements Component ( Private Component[ ] children; )
您可能感兴趣的试卷
你可能感兴趣的试题
public class MethodOver {
public void setVar (int a, int b, float c) {
}
}
Which two overload the setVar method?()
A. Private void setVar (int a, float c, int b) { }
B. Protected void setVar (int a, int b, float c) { }
C. Public int setVar (int a, float c, int b) (return a;)
D. Public int setVar (int a, int b, float c) (return a;)
E. Protected float setVar (int a, int b, float c) (return c;)
public class ConstOver {
public ConstOver (int x, int y, int z) {
}
}
Which two overload the ConstOver constructor?()
A. ConstOver ( ) { }
B. Protected int ConstOver ( ) { }
C. Private ConstOver (int z, int y, byte x) { }
D. Public Object ConstOver (int x, int y, int z) { }
E. Public void ConstOver (byte x, byte y, byte z) { }
public class test {
public static void add3 (Integer i)
int val = i.intValue ( );
val += 3;
i = new Integer (val);
}
public static void main (String args [ ] ) {
Integer i = new Integer (0);
add3 (i);
system.out.printIn (i.intValue ( ) );
}
What is the result?()
A. Compilation will fail.
B. The program prints “0”.
C. The program prints “3”.
D. Compilation will succeed but an exception will be thrown at line 3.
public class test (
private static int j = 0;
private static boolean methodB(int k) (
j += k;
return true;
)
public static void methodA(int i)(
boolean b:
b = i < 10 | methodB (4);
b = i < 10 || methodB (8);
)
public static void main (String args[])(
methodA (0);
system.out.printIn(j);
)
)
What is the result?()
A. The program prints “0”
B. The program prints “4”
C. The program prints “8”
D. The program prints “12”
E. The code does not complete.
Integer i = new Integer (42);
Long 1 = new Long (42);
Double d = new Double (42.0);
Which two expressions evaluate to True?()
A. (i ==1)
B. (i == d)
C. (d == 1)
D. (i.equals (d))
E. (d.equals (i))
F. (i.equals (42)
1.public class test (
2.public static void main (String args[]) {
3.int i = 0xFFFFFFF1;
4.int j = ~i;
5.
6.}
7.)
What is the decimal value of j at line 5?()
A. 0
B. 1
C. 14
D. –15
E. An error at line 3 causes compilation to fail.
F. An error at line 4 causes compilation to fail.
A. 3/2
B. 3<2
C. 3*4
D. 3<<2
E. 3*2^2
F. 3<<<2
public class X {
public static void main (String[] args) {
byte b = 127;
byte c = 126;
byte d = b + c;
}
}
Which statement is true?()
A. Compilation succeeds and d takes the value 253.
B. Line 5 contains an error that prevents compilation.
C. Line 5 throws an exception indicating “Out of range”
D. Line 3 and 4 contain error that prevent compilation.
E. The compilation succeeds and d takes the value of 1.
最新试题
What is the result?()
Given that Triangle implements Runnable, and:Which two statements, inserted independently at both lines 35 and 41, tend to allow both threads to temporarily pause and allow the other thread to execute?()
What is the result?()
Which statement is true?()
What is the result?()
Which statement is true?()
Which statement is true?()
Which two can be results?()
What is the result?()
Which statement is true?()