Data Types and Variables Determine output:public class Test{ int a = 10; public void method(int a){ a += 1; System.out.println(++a); } public static void main(String args[]){ Test t = new Test(); t.method(3); }} 12 4 None of these 5 11 12 4 None of these 5 11 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. int i = 010;4. int j = 07;5. System.out.println(i);6. System.out.println(j);7. }8. } Compilation fails with an error at line 3 8 7 10 7 Compilation fails with an error at line 5 None of these Compilation fails with an error at line 3 8 7 10 7 Compilation fails with an error at line 5 None of these 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 true Prints false Will not compile as boolean is not initialized Will not compile as boolean can never be static Prints true Prints false ANSWER DOWNLOAD EXAMIANS APP
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);} } Compilation Error None of these 10 50 Compilation Error None of these 10 50 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 Compilation Error Throws Exception 22 21 20 Compilation Error Throws Exception 22 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables In Java, the word true is ................ Same as value 0 A Java keyword Same as value 1 A Boolean literal Same as value 0 A Java keyword Same as value 1 A Boolean literal ANSWER DOWNLOAD EXAMIANS APP