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 20 Error 10 20 10 100 10 20 10 10 10 20 10 20 Error 10 20 10 100 10 20 10 10 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(); }} None of these 0 false 0 0 0 0 Compile error - static variable must be initialized before use. 0 true 0 None of these 0 false 0 0 0 0 Compile error - static variable must be initialized before use. 0 true 0 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables The following fraction of codedouble STATIC = 2.5 ;System.out.println( STATIC ); Prints 2.5 Raises an exception Rraises an error as STATIC is used as a variable which is a keyword None of these Prints 2.5 Raises an exception Rraises an error as STATIC is used as a variable which is a keyword None of these ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What will be output of following program?public class Test{ public static void main(String[] args){ byte b=127; b++; b++; System.out.println(b); }} 2 Compiler error None of these 129 -127 2 Compiler error None of these 129 -127 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Size of float and double in Java is 32 and 32 64 and 32 64 and 64 32 and 64 32 and 32 64 and 32 64 and 64 32 and 64 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Size of int in Java is 32 bit 64 bit 16 bit Depends on execution environment 32 bit 64 bit 16 bit Depends on execution environment ANSWER DOWNLOAD EXAMIANS APP