Java Fundamentals  «Prev  Next»


Primitive Types and Literal Values - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Which of the following are primitive types?
Please select all the correct answers.
  A. Float
  B. String
  C. Integer
  D. double

2. What is the range of values of the short type?
Please select the best answer.
  A. 0 to 216
  B. -(216) to 216
  C. -(215) to 215 - 1
  D. -(215) to 215

3. Which of the following are the values of a primitive type?
Please select all the correct answers.
  A. 123.456
  B. false
  C. "true"
  D. null

4. What is the output of the following program?
class Question {
 public static void main(String[] args) {
  System.out.println("\\\"\\\\\"");
 }
}
Please select the best answer.
  A. \\\"\\\\\"
  B. \\\\\\\\
  C. \"\\"
  D. "\"