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 double Compilation Error Exception is thrown at runtime float double Compilation Error Exception is thrown at runtime 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 ) ; }} Throws Exception 21 Compilation Error 20 22 Throws Exception 21 Compilation Error 20 22 ANSWER DOWNLOAD EXAMIANS APP
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. } 17 None of these Compilation fails with an error at line 5 Compilation fails with an error at line 8 0 17 None of these Compilation fails with an error at line 5 Compilation fails with an error at line 8 0 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables Java is a ........... language. strongly typed None of these moderate typed weakly typed strongly typed None of these moderate typed weakly typed ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What is the output for the below code?public class Test{ int _$; int $7; int do; public static void main(String argv[]){ Test test = new Test(); test.$7=7; test.do=9; System.out.println(test.$7); System.out.println(test.do); System.out.println(test._$); }} Compile error - $7 is not valid identifier. 7 0 0 7 9 0 Compile error - do is not valid identifier. None of these Compile error - $7 is not valid identifier. 7 0 0 7 9 0 Compile error - do is not valid identifier. None of these 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 None of these 0 0 0 Compile error - static variable must be initialized before use. 0 false 0 0 true 0 None of these 0 0 0 Compile error - static variable must be initialized before use. 0 false 0 ANSWER DOWNLOAD EXAMIANS APP