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 true Will not compile as boolean can never be static Prints false Will not compile as boolean is not initialized Prints true Will not compile as boolean can never be static Prints false 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 float double Exception is thrown at runtime Compilation Error float double Exception is thrown at runtime ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables How many primitive data types are there in Java? 7 9 6 8 7 9 6 8 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Automatic type conversion in Java takes place when 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 shorter than source type. Two type are compatible and size of destination type is equal of 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 shorter than source type. Two type are compatible and size of destination type is equal of source type. ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables 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 ) ; }} Compilation Error 22 20 21 Throws Exception Compilation Error 22 20 21 Throws Exception ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables 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 Compilation fails with an error at line 6 None of these 14 13 Compilation fails with an error at line 4 14 21 Compilation fails with an error at line 6 None of these 14 13 Compilation fails with an error at line 4 ANSWER DOWNLOAD EXAMIANS APP