
Chapter-5 Quiz on Primitive Values, Type Casting and Expression
Quiz by Tamilselvi Manuel
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
What is the output of the following Java Code?int a=9;float b = a/2;System.out.println(b);
What is the output of the below Java code snippet?char ch = 'A';//ASCII 65int a = ch + 1;ch = (char)a;System.out.println(ch);
What is the output of the below Java code snippet?float a = 8.2/2;System.out.println(a);
What is the output of the Java code snippet?byte b = 25;b++;b = b+1;System.out.println(b);
What is the output of the Java code snippet?int a = 260;byte b= (byte)a;System.out.println(b);
A boolean literal in Java can be type casted to which data type?
If a variable or operand in an expression is type long, then all the operands are type promoted to which data type?
What is the suffix used to represent a floating point number in Java?
A character literal in Java is enclosed within a pair of ___?
Which among the following is not a primitive data type in Java?
Choose the correct usage of boolean literal in the options below.
Choose the wrong Java code statement below.
Choose the wrong Java code statement below.
What is the default boolean literal assigned to a boolean variable in Java?
What is the default return type of a method in Java language?A) voidB) intC) shortD) None of the above