InstructionsTotal Questions: 20Total Minutes: 20This ExamTray Free Online Exam/Quiz/Trivia tests your Java Programming Skills on Java Type Casting rules and Type Promotions. This test displays answers after finishing the exam for review. You can easily clear Competitive Exams and Job Interview Questions after attending this exam. Go through Java Theory Notes on Type Promotions 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) What are the Type Conversions available in Java language? A) Narrowing Type Conversion B) Widening Type Conversion C) A and B D) None of the above 2) What is a higher data type in Java language? A) A data type which holds more data than other data types B) A data type whose size is more than other data types C) A data type which can hold more precision digits than other data types D) All the above 3) What is a Widening Type Conversion in Java? A) Conversion of data from higher data type to lower data type B) Conversion of data from lower data type to higher data type C) Conversion of data from any data type to any data type D) None of the above 4) What is a Narrowing Type Conversion in Java? A) Conversion of data from lower data type to higher data type B) Conversion data from a higher data type to a lower data type C) Conversion of data from any data type to any data type D) None of the above 5) What is the result of a Narrowing type conversion? A) Loss of data B) Addition of data C) Corruption of data D) None of the above 6) What is the result of a Widening Type Conversion in Java? A) Loss of data B) Gain of data C) No change D) None of the above 7) Type promotion in Java usually refers to ____. A) Narrowing Type Conversion B) Widening Type Conversion C) No Type Conversion D) None of the above Ad 8) Type Casting in Java usually refers to ____? A) Narrowing Type Conversion B) Widening Type Conversion C) No Type Conversion D) None of the above 9) Explicit Type Conversion in Java refers to ___? A) Narrowing Type Conversion B) Widening Type Conversion C) No Type Conversion D) None of the above 10) Implicit Type Conversion in Java is also called ___? A) Narrowing Type Conversion B) Widening Type Conversion C) No Type Conversion D) None of the above 11) Which are the compatible Data Types for Type Promotion or Type Casting? A) byte, char, short B) char, int, float C) float, long, double D) All the above 12) What is the output of the following Java Code? int a=9; float b = a/2; System.out.println(b); A) 4.0 B) 4.5 C) 5.0 D) None of the above 13) What is the output of the below Java code snippet? char ch = 'A';//ASCII 65 int a = ch + 1; ch = (char)a; System.out.println(ch); A) 66 B) A C) B D) 65 14) What is the output of the below Java code snippet? float a = 8.2/2; System.out.println(a); A) 4.1 B) 8.1 C) 4 D) Compiler error Ad 15) What is the output of the Java code snippet? byte b = 25; b++; b = b+1; System.out.println(b); A) 25 B) 26 C) 27 D) Compiler error 16) What is the output of the Java code snippet? int a = 260; byte b= (byte)a; System.out.println(b); A) 0 B) 4 C) 255 D) 260 17) In a lossy Type Casting or Type Conversion, how is the number truncated to the target data type in Java? A) That big number is divided by the target data type highest possible number say 2^N. B) That big number is Modulo Divided by the target data type highest possible number say 2^N and the Remainder is taken. C) That big number is Modulo Divided by the target data type highest possible number say 2^N and the Quotient is taken. D) None of the above 18) What is the output of the Java code snippet? short a = (short)65540; System.out.println(a); A) 0 B) 4 C) 65536 D) 65540 19) A boolean literal in Java can be type casted to which data type? A) byte B) short C) int D) None of the above 20) If a variable or operand in an expression is type long, then all the operands are type promoted to which data type? A) int B) long C) float D) double FINISH EXAM 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*PREVJava Literals Online Test 2 NEXTJava Arithmetic Operators Online Test-1 Certification Group ID 3845