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 is not initialized Prints false Will not compile as boolean can never be static Prints true Will not compile as boolean is not initialized Prints false Will not compile as boolean can never be static Prints true 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); }} 129 None of these -127 2 Compiler error 129 None of these -127 2 Compiler error ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What will the output of the following program?public class Test{ public static void main(String args[]){ float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); }} 3 0 2 2.5 25 3 0 2 2.5 25 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables 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 double Exception is thrown at runtime float Compilation Error double Exception is thrown at runtime float ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables How many primitive data types are there in Java? 7 8 9 6 7 8 9 6 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables 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. } Compilation fails with an error at line 3 None of these 128 Compilation fails with an error at line 4 0 Compilation fails with an error at line 3 None of these 128 Compilation fails with an error at line 4 0 ANSWER DOWNLOAD EXAMIANS APP