Data Types and Variables How many primitive data types are there in Java? 8 7 6 9 8 7 6 9 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What will be the output for the below code ?1. public class Test{2. public static void main(String[] args){3. byte i = 128;4. System.out.println(i);5. }6. } None of these Compilation fails with an error at line 4 128 Compilation fails with an error at line 3 0 None of these Compilation fails with an error at line 4 128 Compilation fails with an error at line 3 0 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What is the output for the below code ?1. public class Test{2. public static void main(String[] args){3. int i = 010;4. int j = 07;5. System.out.println(i);6. System.out.println(j);7. }8. } 8 7 None of these Compilation fails with an error at line 5 10 7 Compilation fails with an error at line 3 8 7 None of these Compilation fails with an error at line 5 10 7 Compilation fails with an error at line 3 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What would be the output of the following fraction of code ?int Integer = 34 ;char String = 'S' ;System.out.print( Integer ) ;System.out.print( String ) ; 34 Does not compile as Integer and String are API class names. 34 S Throws exception. S 34 Does not compile as Integer and String are API class names. 34 S Throws exception. S ANSWER DOWNLOAD EXAMIANS APP
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 13 None of these Compilation fails with an error at line 6 14 21 Compilation fails with an error at line 4 14 13 None of these Compilation fails with an error at line 6 14 21 Compilation fails with an error at line 4 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables What will the output of the following program?public class Test{ public static void main(String args[]){ float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); }} 2.5 25 0 3 2 2.5 25 0 3 2 ANSWER DOWNLOAD EXAMIANS APP