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); }} double Exception is thrown at runtime float Compilation Error double Exception is thrown at runtime float Compilation Error ANSWER DOWNLOAD EXAMIANS APP
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 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 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables How many primitive data types are there in Java? 7 6 8 9 7 6 8 9 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables 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 34 Does not compile as Integer and String are API class names. Throws exception. S 34 S 34 Does not compile as Integer and String are API class names. Throws exception. S 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 ) ; }} 21 20 Throws Exception Compilation Error 22 21 20 Throws Exception Compilation Error 22 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables In Java, the word true is ................ A Java keyword A Boolean literal Same as value 1 Same as value 0 A Java keyword A Boolean literal Same as value 1 Same as value 0 ANSWER DOWNLOAD EXAMIANS APP