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 keywords are used to control access to a class member?
(A) default
(B) abstract
(C) protected
(D) interface
(E) public

  All of these.

  (B), (C) & (E)

  (A), (C) & (E)

  (C) & (E)

  Half-n-half Clue
 

2.

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

  (A), (D) & (E)

  (D)

  (D) & (E)

  (C), (D) & (E)

  Half-n-half Clue
 

3.

A package is a collection of

  classes and interfaces

  editing tools

  interfaces

  classes

  Half-n-half Clue
 

4.

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
.

  (D)

  (A)

  (A) & (C)

  (B) & (C)

  Half-n-half Clue
 

5.

Package p1 contains the following code:
package p1;
public class Student

  Test class is not available.

  Class result should be declared public.

  Student class is not available.

  Result body is not fully defined.

  Half-n-half Clue
 

6.

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

  (D)

  (A) & (C)

  (E)

  (B) & (C)

  Half-n-half Clue
 

7.

Consider the following code:
class ClassA

  Will compile and run successfully

  Error. ClassB does not define a no-argument constructor

  Error. ClassA does not define a no-argument constructor

  Error. There is no code in the class ClassB

  Error. There is no code in the constructor ClassA(int x)

  Half-n-half Clue
 


 
12 more pages in Java Programming


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