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 2.5 25 0 3 2 2.5 25 0 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Size of int in Java is 16 bit 64 bit 32 bit Depends on execution environment 16 bit 64 bit 32 bit Depends on execution environment ANSWER DOWNLOAD EXAMIANS APP
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); }} 10 20 10 10 10 20 10 20 10 20 10 100 Error 10 20 10 10 10 20 10 20 10 20 10 100 Error ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What is the output for the below code ?class A{ int k; boolean istrue; static int p; public void printValue(){ System.out.print(k); System.out.print(istrue); System.out.print(p); }}public class Test{ public static void main(String argv[]){ A a = new A(); a.printValue(); }} 0 true 0 0 0 0 0 false 0 None of these Compile error - static variable must be initialized before use. 0 true 0 0 0 0 0 false 0 None of these Compile error - static variable must be initialized before use. ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables How many primitive data types are there in Java? 8 7 6 9 8 7 6 9 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 20 22 Throws Exception 21 Compilation Error 20 22 Throws Exception 21 ANSWER DOWNLOAD EXAMIANS APP