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  

1.

Which of the following statements are true?
(A) An abstract class may not have any final methods.
(B) A final class may not have any abstract methods.
(C) An inner class may be declared with any accessibility keyword.
(D) Transient variables must be static
.

  (B) & (C)

  (D)

  (A)

  (A) & (C)

  Half-n-half Clue
 

2.

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

  Visible only inside the package.

  Visible only in the class where it is declared.

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

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

  Half-n-half Clue
 

3.

The keywords reserved but not used in the initial version of Java are:
(A) union
(B) const
(C) inner
(D) goto
(E) boolean
(F) synchronized

  (C) & (E)

  All of these.

  (B),(C) & (D)

  (A), (C) & (E)

  Half-n-half Clue
 

4.

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

  private

  final

  protected

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

  Half-n-half Clue
 

5.

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

  (C), (D) & (E)

  (D)

  (A), (D) & (E)

  (D) & (E)

  Half-n-half Clue
 

6.

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

  (B) & (C)

  (D)

  (A) & (C)

  (E)

  Half-n-half Clue
 

7.

A package is a collection of

  classes and interfaces

  interfaces

  editing tools

  classes

  Half-n-half Clue
 


 
12 more pages in Java Programming


Contact Info © 1999-2025 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright
Previous
-
Next
-