单项选择题
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” -
单项选择题
byte [] arry1, array2[]; byte array3 [][]; byte[][] array4; If each array has been initialized, which statement will cause a compiler error?()
A. Array2 = array1;
B. Array2 = array3;
C. Array2 = array4;
D. Both A and B
E. Both A and C
F. Both B and C -
单项选择题
Whichdeclarationpreventscreatingasubclassofanouterclass?()
A. Static class FooBar{}
B. Private class FooBar{}
C. Abstract public class FooBar{}
D. Final public class FooBar{}
E. Final abstract class FooBar{}
