Syvum Home Page

Home > Quiz Games > Java Programming >

Java Programming : Classes and Keywords: Multiple Choice

Answer the following questions about classes and reserved keywords as used in the Java programming language.

Formats Info Page Worksheet / Test Paper Quiz Review
Multiple choice

Your Performance  


Which of the following keywords are used to control access to a class member?
(A) default
(B) abstract
(C) protected
(D) interface
(E) public

  All of these.

  (A), (C) & (E)

  (B), (C) & (E)

  (C) & (E)

  Half-n-half Clue


The use of protected keyword to a member in a class will restrict its visibility as follows:

  Visible in all classes in the same package and subclasses in other packages.

  Visible only in the class where it is declared.

  Visible only in the class and its subclass in the same package.

  Visible only inside the package.

  Half-n-half Clue


Which of the following statements about abstract methods/classes in Java are true?
1. An abstract class cannot be instantiated.
2. Constructors cannot be abstract.
3. A subclass of an abstract class must defined the abstract methods.
4. Static methods may be declared abstract.

  Line 1, line 2 and line 3 only

  Line 1 only

  Line 1 and line 2 only

  Line 2 only

  All are true

  Half-n-half Clue


We would like to make a member of a class visible in all subclasses regardless of what package they are in. Which one of the following keywords would achieve this?

  private OR protected




  Half-n-half Clue


Which keyword can protect a class in a package from accessibility by the classes outside the package?

  don't use any keyword at all (make it default)




  Half-n-half Clue


Which of the following are not keywords?
(B) implements
(C) protected
(D) extended
(E) string

  (C), (D) & (E)

  (D) & (E)

  (A), (D) & (E)


  Half-n-half Clue


Which of the following are keywords?
(A) switch
(B) integer
(C) default
(D) boolean
(E) object

  (B) & (C)


  (A) & (C)


  Half-n-half Clue

FREE PREVIEW: Last 7 Questions not a part of the free preview. Get Premium Membership to view all questions.

12 more pages in Java Programming

Contact Info © 1999-2018 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright