Data Types and Variables Determine output:class A{ public static void main(String args[]){ int x; x = 10; if(x == 10){ int y = 20; System.out.print("x and y: "+ x + " " + y); y = x*2; } y = 100; System.out.print("x and y: " + x + " " + y); }} Error 10 20 10 20 10 20 10 10 10 20 10 100 Error 10 20 10 20 10 20 10 10 10 20 10 100 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); }} 25 3 2 2.5 0 25 3 2 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); }} 5 12 4 11 None of these 5 12 4 11 None of these ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Which of the following automatic type conversion will be possible? long to int short to int int to long byte to int long to int short to int int to long byte to int 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. } None of these Compilation fails with an error at line 3 10 7 8 7 Compilation fails with an error at line 5 None of these Compilation fails with an error at line 3 10 7 8 7 Compilation fails with an error at line 5 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Size of int in Java is 32 bit 64 bit Depends on execution environment 16 bit 32 bit 64 bit Depends on execution environment 16 bit ANSWER DOWNLOAD EXAMIANS APP