InstructionsTotal Questions: 20Total Minutes: 20This ExamTray Free Online Test or Quiz or Trivia tests your Programming Skills on the basics of Java Autoboxing and Unboxing. This practice test displays answers after finishing the exam for review. You can easily clear Competitive Exams and Job Interview Questions. Students can learn Java basics. Go through Java Theory Notes on Wrappers and Autoboxing before attempting this test. All the Best Challenge SCORE0 / 20Take This Exam 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*Q Buttons 1) Choose a correct statement about Autoboxing in Java? A) Boxing is the process of converting a primitive data to its equivalent Wrapper class type B) Unboxing is the process of converting a Wrapper class object to its equivalent primitive data type C) Autoboxing is the process of converting Primitive data type to Wrapper Object type automatically. Auto-Unboxing is the process of converting Wrapper type object to Primitive type automatically. D) All the above 2) Which does autoboxing or unboxing in Java? A) Compiler B) Runtime C) Third party tools D) None 3) Autoboxing or unboxing involves replacement of Wrapper objects with Primitives and vice versa. State TRUE or FALSE. A) TRUE B) FALSE C) - D) - 4) Which Java version introduced the feature Autoboxing and Unboxing? A) Java 4 B) Java 5 C) Java 6 D) Java 7 5) What is the need for Autoboxing and Unboxing in Java? A) Reduces code to be written by developers to convert from Wrapper to Primitive vice versa B) Compile time is reduced due to fixed methods followed to automatically convert Objects and Primitives C) Auto-unboxing improves memory efficiency by converting Wrapper to Primitive and process when object version is not needed D) All the above 6) Choose the right statement which does autoboxing in Java? A) Integer temperature1 = 100; B) int temperature2 = 101; C) Integer temperature1 = 100; int temperature2 = 101; D) All the above 7) Choose the correct way of autoboxing Primitives to Wrapper objects below? A) Float f1 = 1.0f; B) Boolean bull = false; C) Character ch = 'a'; D) All the above Ad 8) Does the below Java code undergoes autoboxing correctly? long weight = 10; Long wei = weight; System.out.println(ch.SIZE); A) Yes B) No C) - D) - 9) Auto-boxing or Auto-unboxing involves assignment (not always) in Java. State TRUE or FALSE. A) TRUE B) FALSE C) - D) - 10) Auto-boxing or Auto-unboxing does not work inside static methods in Java. State TRUE or FALSE A) FALSE B) TRUE C) - D) - 11) What is the output of the below java code with autoboxing? public class AutoBoxingTest2 { static void show(int reading) { System.out.println("Reading: " + reading); } public static void main(String[] args) { Integer a = Integer.valueOf(10); show(a); } } A) Reading: 0 B) Reading: 10 C) Compiler error D) None 12) Which is faster Auto-boxing or Auto-unboxing? A) Auto-boxing B) Auto-unboxing C) - D) - 13) Does autoboxing work with creation of an Array in Java? A) Yes B) No C) - D) - 14) Autoboxing or Auto-unboxing works with ___ in Java. A) Loops, Switch statements B) Ternary Operator C) IF ELSE statements D) All the above Ad 15) Autoboxing or Auto-unboxing is ___ in Java. A) Implicit B) Explicit C) - D) - 16) Choose the correct code that does auto-unboxing? A) Character ch = 'S'; switch(ch) { case 'S': System.out.println("OK"); break; case 'p': break; } //OUTPUT OK B) Integer t = 90; int abc = ++t; System.out.println(abc); //OUTPUT 91 C) int b = 10; Integer c = 20; if(b < c) { System.out.println("LESS"); } //OUTPUT LESS D) All the above 17) What is the output of the below Java code snippet that use Autoboxing and Unboxing? public class AutoUnboxingTest1 { public static void main(String[] args) { int apple1 = 10; Integer apple2 = 10; if(apple1 == apple2) System.out.println("apple1=apple2"); else System.out.println("apple1!=apple2"); } } A) apple1=apple2 B) apple1!=apple2 C) Compiler error D) Non 18) Autoboxing and unboxing in Java language saves the programmer from errors and extra lines of code. State TRUE or FALSE. A) TRUE B) FALSE C) - D) - 19) What is the output of the below Java code with Autoboxing and unboxing? float f1 = 10.0f; Float f2 = Float.valueOf(10); if(f1 == f2) System.out.println("FLOATs are equal."); else System.out.println("FLOATs are not equal."); A) FLOATs are equal. B) FLOATs are not equal. C) Compiler error D) None 20) Choose the correct statement with auto-unboxing in Java? A) Short s1 = (short)30; short s2 = s1; B) Boolean b1 = Boolean.valueOf(true); boolean b2 = b1; C) Character ch1 = Character.valueOf('a'); char ch2 = ch1; D) All the above FINISH EXAM 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*PREV Java Wrapper Online Test 1 NEXT Java Enum Online Test Certification Group ID 0