Data Types and Variables What will be output of the following program code?public class Test{public static void main(String[] a){short x = 10;x = x*5;System.out.print(x);} } None of these 50 10 Compilation Error None of these 50 10 Compilation Error ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Size of int in Java is 16 bit Depends on execution environment 32 bit 64 bit 16 bit Depends on execution environment 32 bit 64 bit 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); } } 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 Will not compile as boolean can never be static 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);}} 34 34 65 34 34 65 65 65 34 34 65 34 34 65 65 65 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables In Java, the word true is ................ Same as value 0 A Java keyword A Boolean literal Same as value 1 Same as value 0 A Java keyword A Boolean literal Same as value 1 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What is the output for the below code?public class Test{ int _$; int $7; int do; public static void main(String argv[]){ Test test = new Test(); test.$7=7; test.do=9; System.out.println(test.$7); System.out.println(test.do); System.out.println(test._$); }} None of these 7 0 0 Compile error - do is not valid identifier. 7 9 0 Compile error - $7 is not valid identifier. None of these 7 0 0 Compile error - do is not valid identifier. 7 9 0 Compile error - $7 is not valid identifier. ANSWER DOWNLOAD EXAMIANS APP