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.

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

  public

  private

  protected

  Half-n-half Clue
 

2.

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

  (B) & (C)

  (E)

  (D)

  (A) & (C)

  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

  (A), (C) & (E)

  (C) & (E)

  All of these.

  (B),(C) & (D)

  Half-n-half Clue
 

4.

A package is a collection of

  interfaces

  editing tools

  classes and interfaces

  classes

  Half-n-half Clue
 

5.

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

  (A), (C) & (E)

  All of these.

  (B), (C) & (E)

  (C) & (E)

  Half-n-half Clue
 

6.

Which of the following defines a legal abstract class?

  abstract Vehicle {<br>
              abstract void display(); }

  abstract class Vehicle {<br>
              abstract void display(); }

  class abstract Vehicle {<br>
              abstract void display(); }

  class Vehicle {<br>
              abstract void display(); }

  abstract class Vehicle {<br>
              abstract void display(); {<br>
                System.out.println("Car"); }}

  Half-n-half Clue
 

7.

Consider the following code:
interface Area

  All of these

  Method compute() in interface Area should be declared public

  Interface definition is incomplete

  Method compute() in class Room should be declared public

  Half-n-half Clue
 


 
12 more pages in Java Programming


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