TOTAL QS = 20Time [ 00 : 00 : 00 ]
00:00:00

Java Basics: Type Casting Online Test 1

Instructions

Total Questions: 20

Total Minutes: 20

This 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 SCORE

0 / 20

Take This Exam
1) What are the Type Conversions available in Java language?
2) What is a higher data type in Java language?
3) What is a Widening Type Conversion in Java?
4) What is a Narrowing Type Conversion in Java?
5) What is the result of a Narrowing type conversion?
6) What is the result of a Widening Type Conversion in Java?
7) Type promotion in Java usually refers to ____.
8) Type Casting in Java usually refers to ____?
9) Explicit Type Conversion in Java refers to ___?
10) Implicit Type Conversion in Java is also called ___?
11) Which are the compatible Data Types for Type Promotion or Type Casting?
12)
What is the output of the following Java Code?
int a=9;
float b = a/2;
System.out.println(b);
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);
14)
What is the output of the below Java code snippet?
float a = 8.2/2;
System.out.println(a);
15)
What is the output of the Java code snippet?
byte b = 25;
b++;
b = b+1;
System.out.println(b);
16)
What is the output of the Java code snippet?
int a = 260;
byte b= (byte)a;
System.out.println(b);
17) In a lossy Type Casting or Type Conversion, how is the number truncated to the target data type in Java?
18)
What is the output of the Java code snippet?
short a = (short)65540;
System.out.println(a);
19) A boolean literal in Java can be type casted to which data type?
20) If a variable or operand in an expression is type long, then all the operands are type promoted to which data type?
Certification Group ID
3845

Open Certification Helper Popup Reset Popup