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); }} Compilation Error double Exception is thrown at runtime float Compilation Error double Exception is thrown at runtime float 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 10 None of these 50 Compilation Error 10 None of these 50 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); }} 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 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 5 None of these 11 4 12 5 None of these 11 4 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 Prints false Prints true Will not compile as boolean can never be static Will not compile as boolean is not initialized Prints false Prints true Will not compile as boolean can never be static ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Which of the following automatic type conversion will be possible? byte to int short to int long to int int to long byte to int short to int long to int int to long ANSWER DOWNLOAD EXAMIANS APP