Data Types and Variables What is the output for the below code ?1. public class Test{2. public static void main(String[] args){3. byte b = 6;4. b+=8;5. System.out.println(b);6. b = b+7;7. System.out.println(b);8. }9. } 14 21 14 13 Compilation fails with an error at line 6 Compilation fails with an error at line 4 None of these 14 21 14 13 Compilation fails with an error at line 6 Compilation fails with an error at line 4 None of these 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
Data Types and Variables In Java byte, short, int and long all of these are None of these unsigned signed Both of the above None of these unsigned signed Both of the above 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); }} Exception is thrown at runtime double Compilation Error float Exception is thrown at runtime double Compilation Error float ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables The smallest integer type is ......... and its size is ......... bits. short, 16 byte, 8 short, 8 short, 16 short, 16 byte, 8 short, 8 short, 16 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); }} 11 None of these 12 4 5 11 None of these 12 4 5 ANSWER DOWNLOAD EXAMIANS APP