InstructionsTotal Questions: 18Total Minutes: 18This ExamTray Free Online Test or Quiz or Trivia tests your Programming Skills on the basics of Java Type Wrapper Classes. 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 Type Wrappers before attempting this test. All the Best Challenge SCORE0 / 18Take This Exam 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*Q Buttons 1) What is a Type Wrapper or simply a Wrapper in Java? A) A Wrapper class is an object version of Primitive Data Type B) A Wrapper provides additional methods for ease of use C) Wrapper types are useful for using with generic collections D) All the above 2) Which primitive data types have wrapper classes available? A) byte, short, int, long B) float, double C) boolean, char D) All the above 3) Choose the correct mapping of Primitive Data Types and Wrapper Classes below? A) boolean = Boolean, char = Character B) byte = Byte, short = Short, int = Integer, long = Long C) float = Float, double = Double D) All the above 4) State TRUE or FALSE. Java primitive data types work faster compared to their Wrapper counter parts. A) TRUE B) FALSE C) - D) - 5) Which is the correct way of converting an int value to Integer in below Java code? A) Integer in = new Integer(9); B) Integer in = Integer.valueOf(9); C) Integer in = new Integer("9"); D) None of the above 6) Which is the Superclass of Wrapper types like Byte, Short, Integer, Long, Float and Double? A) Math B) System C) Number D) Enum 7) Which are the methods a Wrapper class object can use in Java? A) byteValue(), shortValue, intValue(), longValue() B) floatValue(), doubleValue() C) booleanValue(), charValue() D) All the above Ad 8) Which is the superclass of wrapper classes like Boolean and Character? A) Number B) Wrapper C) Object D) Math 9) Are the sizes of float and Float same or different in Java? A) Same B) Different C) - D) - 10) Which are the constant fields available a Wrapper Class object in Java? A) BYTES, SIZE B) MAX_VALUE, MAX_EXPONENT C) MIN_VALUE, MIN_EXPONENT D) All the above 11) What is the output of the below Java code snippet on wrapper classes? System.out.println(Byte.BYTES); System.out.println(Character.BYTES); System.out.println(Short.BYTES); System.out.println(Integer.BYTES); System.out.println(Long.BYTES); System.out.println(Float.BYTES); System.out.println(Double.BYTES); A) 1 2 2 4 8 4 8 B) 1 4 2 4 8 4 8 C) 1 2 4 8 16 8 16 D) None of the above 12) Choose the correct way of creating a Float wrapper object in Java? A) Float pi = Float.valueOf(2.54f); B) Float pi = Float.valueOf(2.54); C) Float pi = new Float(2.54f); D) Float pi = new Float("2.54f"); 13) Choose the correct way of comparing Wrapper objects in Java? A) float p1 = 10.45f; float p2 = 5.2f; if(Float.compare(p1, p2) == 1) { System.out.println("10.45 > 5.2"); } else System.out.println("No Biscuits"); //OUTPUT 10.45 > 5.2 B) Float f1 = Float.valueOf("2.55"); Float f2 = Float.valueOf("4.5"); if(f1.compareTo(f2) == -1) { System.out.println("2.55 < 4.5"); } else System.out.println("No Tea"); //OUTPUT 2.55 < 4.5 C) float t1 = 2.0f; float t2 = 2.0f; if(Float.compare(t1, t2) == 0) { System.out.println("Float numbers are equal"); } //OUTPUT Float numbers are equal D) All the above 14) Choose the correct statement about Character wrapper class in Java? A) Character class has static methods toUpperCase(char), toLowerCase(char) B) Character class has static methods isDigit(char), isLetter(char) C) Character class has static method valueOf(char) to convert char to Character. D) All the above Ad 15) Choose the correct statement about Boolean wrapper class in Java? A) Boolean class has static methods valueOf(boolean), valueOf("boolean") to convert boolean to Boolean object B) Boolean class has static methods logicalAnd(boolean, boolean), logicalOr(boolean, boolean), logicalXor(boolean,boolean) C) Boolean class has instance method equals() to check equality. compare() and compareTo() methods are also available D) All the above 16) Which exception is thrown for trying to create Wrapper class objects with wrong number type? A) ArithmeticException B) NumberFormatException C) IllegarArgumentException D) TypeNotPresentException 17) What is the output of the below code snipper with Short class object? Short sh = Short.valueOf(10); System.out.println(sh); A) 10 B) 0 C) Compiler error D) None 18) Choose a correct statement about Type Casting using Wrapper class objects in Java? A) You can not convert from Byte to Integer B) You can not convert from Integer to Float C) You can not convert from Integer to Long D) All the above FINISH EXAM 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*PREV Java Exception Handling Online Test 2 NEXT Java Autoboxing Online Test Certification Group ID 0