The following program:public class Test{ static boolean isOK; public static void main(String args[]){ System.out.print(isOK); } } Will not compile as boolean is not initialized Prints false Will not compile as boolean can never be static Prints true TRUE ANSWER : ? YOUR ANSWER : ?
The smallest integer type is ......... and its size is ......... bits. short, 16 short, 16 byte, 8 short, 8 TRUE ANSWER : ? YOUR ANSWER : ?
In Java byte, short, int and long all of these are Both of the above signed unsigned None of these TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output for the below code ?1. public class Test{2. public static void main(String[] args){3. byte i = 128;4. System.out.println(i);5. }6. } 128 Compilation fails with an error at line 3 Compilation fails with an error at line 4 None of these 0 TRUE ANSWER : ? YOUR ANSWER : ?
Determine output:public class Test { static void test(float x){ System.out.print("float"); } static void test(double x){ System.out.print("double"); } public static void main(String[] args){ test(99.9); }} Compilation Error Exception is thrown at runtime double float TRUE ANSWER : ? YOUR ANSWER : ?
Automatic type conversion in Java takes place when Two type are compatible and size of destination type is shorter than source type. All of these Two type are compatible and size of destination type is larger than source type. Two type are compatible and size of destination type is equal of source type. TRUE ANSWER : ? YOUR ANSWER : ?
Determine output:public class Test{int i = 34;public static void main(String args[]){Test t1 = new Test();Test t2 = new Test();t1.i = 65;System.out.print(t1.i);System.out.print(t2.i);}} 65 65 34 65 65 34 34 34 TRUE ANSWER : ? YOUR ANSWER : ?
What would be the output of the following fraction of code ?int Integer = 34 ;char String = 'S' ;System.out.print( Integer ) ;System.out.print( String ) ; 34 S Throws exception. 34 Does not compile as Integer and String are API class names. S TRUE ANSWER : ? YOUR ANSWER : ?
What is the output for the below code ?1. public class Test{2. public static void main(String[] args){3. byte b = 6;4. b+=8;5. System.out.println(b);6. b = b+7;7. System.out.println(b);8. }9. } 14 21 None of these Compilation fails with an error at line 6 14 13 Compilation fails with an error at line 4 TRUE ANSWER : ? YOUR ANSWER : ?
What is the output of the following program?public class Test{static int x = 10 ; public static void main(String[] a){ Test test = new Test( ) ; Test test1 = new Test( ) ; test.x += 1 ; System.out.println( test.x + test1.x ) ; }} 22 Compilation Error 21 Throws Exception 20 TRUE ANSWER : ? YOUR ANSWER : ?