Data Types and Variables The following program:public class Test{ static boolean isOK; public static void main(String args[]){ System.out.print(isOK); } } Will not compile as boolean can never be static Prints false Prints true Will not compile as boolean is not initialized Will not compile as boolean can never be static Prints false Prints true Will not compile as boolean is not initialized ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What will be the output for the below code ?1. public class Test{2. int i=8;3. int j=9;4. public static void main(String[] args){5. add();6. }7. public static void add(){8. int k = i+j;9. System.out.println(k);10. }11. } 17 Compilation fails with an error at line 5 Compilation fails with an error at line 8 None of these 0 17 Compilation fails with an error at line 5 Compilation fails with an error at line 8 None of these 0 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables In Java byte, short, int and long all of these are None of these Both of the above unsigned signed None of these Both of the above unsigned signed ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables The following fraction of codedouble STATIC = 2.5 ;System.out.println( STATIC ); Raises an exception None of these Prints 2.5 Rraises an error as STATIC is used as a variable which is a keyword Raises an exception None of these Prints 2.5 Rraises an error as STATIC is used as a variable which is a keyword ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What will be output of following program?public class Test{ public static void main(String[] args){ byte b=127; b++; b++; System.out.println(b); }} Compiler error 2 -127 129 None of these Compiler error 2 -127 129 None of these ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables The smallest integer type is ......... and its size is ......... bits. byte, 8 short, 16 short, 16 short, 8 byte, 8 short, 16 short, 16 short, 8 ANSWER DOWNLOAD EXAMIANS APP