Data Types and Variables What will be the output for the below code ?1. public class Test{2. int i=8;3. int j=9;4. public static void main(String[] args){5. add();6. }7. public static void add(){8. int k = i+j;9. System.out.println(k);10. }11. } Compilation fails with an error at line 5 Compilation fails with an error at line 8 None of these 17 0 Compilation fails with an error at line 5 Compilation fails with an error at line 8 None of these 17 0 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); }} float Compilation Error double Exception is thrown at runtime float Compilation Error double Exception is thrown at runtime 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);} } 10 Compilation Error 50 None of these 10 Compilation Error 50 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); }} 129 -127 None of these Compiler error 2 129 -127 None of these Compiler error 2 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 21 20 22 Throws Exception Compilation Error 21 20 22 Throws Exception ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Java is a ........... language. strongly typed weakly typed moderate typed None of these strongly typed weakly typed moderate typed None of these ANSWER DOWNLOAD EXAMIANS APP