Data Types and Variables The following fraction of codedouble STATIC = 2.5 ;System.out.println( STATIC ); Prints 2.5 None of these Raises an exception Rraises an error as STATIC is used as a variable which is a keyword Prints 2.5 None of these Raises an exception Rraises an error as STATIC is used as a variable which is a keyword ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables The smallest integer type is ......... and its size is ......... bits. short, 16 short, 8 byte, 8 short, 16 short, 16 short, 8 byte, 8 short, 16 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 can never be static Will not compile as boolean is not initialized Prints false Prints true Will not compile as boolean can never be static Will not compile as boolean is not initialized Prints false Prints true 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 ) ; }} 22 Compilation Error Throws Exception 20 21 22 Compilation Error Throws Exception 20 21 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 ) ; S Does not compile as Integer and String are API class names. 34 S 34 Throws exception. S Does not compile as Integer and String are API class names. 34 S 34 Throws exception. ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables 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 34 65 65 34 65 34 34 65 34 65 65 34 65 34 34 ANSWER DOWNLOAD EXAMIANS APP