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. } 8 7 None of these Compilation fails with an error at line 3 Compilation fails with an error at line 5 10 7 8 7 None of these Compilation fails with an error at line 3 Compilation fails with an error at line 5 10 7 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 Throws Exception 21 Compilation Error 22 20 Throws Exception 21 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What will the output of the following program?public class Test{ public static void main(String args[]){ float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); }} 3 2 25 2.5 0 3 2 25 2.5 0 ANSWER DOWNLOAD EXAMIANS APP
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); }} 11 None of these 12 4 5 11 None of these 12 4 5 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); }} double float Exception is thrown at runtime Compilation Error double float Exception is thrown at runtime Compilation Error ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Size of int in Java is Depends on execution environment 32 bit 64 bit 16 bit Depends on execution environment 32 bit 64 bit 16 bit ANSWER DOWNLOAD EXAMIANS APP