Tag: Data Types
-
Java Quizs Question & Answers – Character and Boolean Data Types
Q 1. What will be the output of the following Java program? A. 64B. 65C. 67D. 66 Show Answer Answer:-D. 66 Explanation ASCII value of ‘A’ is 65, on using ++ operator character value increments by one. output:$ javac mainclass.java $ java mainclass 66 Q 2. What will be the output of the following Java…
-
Java Quizs Question & Answers – Integer and Floating Data Types
Q 1. An expression involving byte, int, and literal numbers is promoted to which of these?A. longB. intC. byteD. float Show Answer Answer:-B. int Explanation An expression involving bytes, ints, shorts, literal numbers, the entire expression is promoted to int before any calculation is done. Q 2. Which of these literals can be contained in…