Java Fundamentals  «Prev  Next»


Java Key Word Identifier - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Which of the following are valid identifiers?
Please select all the correct answers.
  A. ident-fier
  B. $identifier
  C. 2identifier
  D. a_long_identifier_59

2. Which of the following are Java keywords?
Please select all the correct answers.
  A. sizeof
  B. null
  C. extends
  D. final

3. What is the output of the Question program if it is invoked with the command line?
java Question 1 2 3 4

class Question {
 public static void main(String[] args) {
  System.out.println(args[1]);
 }
}

Please select the best answer.
  A. 1 2 3 4
  B. 1
  C. 2
  D. 2 3 4

4. What is wrong with the following program?

class super {
 public static void main(string[] arguments) {
 }
}
Please select all the correct answers.
  A. super should be public.
  B. super is a keyword and may not be used as a class name.
  C. The argument to the main() method should be of type String[].
  D. The argument to the main() method should be named args.