Ch8 Java

38 Questions  I  By Bing22
Please take the quiz to rate it.

Java Quizzes & Trivia

  
Changes are done, please start the quiz.


Questions and Answers Excerpt

Removing question excerpt is a premium feature

Upgrade and get a lot more done!
1.  Which statement is false?
A.
B.
C.
D.
2.  Having a this reference allows:
A.
B.
C.
D.
3.  Which of the following should usually be private?
A.
B.
C.
D.
4.  : enum types are implicitly ________ and enum constants are implicitly ________.
A.
B.
C.
D.
5.  When no access modifier is specified for a method or variable, the method or variable:
A.
B.
C.
D.
6.  The classpath consists of a list of directories or archive files, each separated by a ________ on Windows or a ________ on UNIX/Linux/Max OS X.
A.
B.
C.
D.
7.   A class within a package must be declared public if
A.
B.
C.
D.
8.   Composition is sometimes referred to as a(n) ________.
A.
B.
C.
D.
9.   Instance variables declared final do not or cannot:
A.
B.
C.
D.
10.  The import declaration import java.util.*; is known as a ________.
A.
B.
C.
D.
11.  Which of the following is false?
A.
B.
C.
D.
12.  Which method returns an array of the enum’s constants?
A.
B.
C.
D.
13.  A package is:
A.
B.
C.
D.
14.  Set methods are also commonly called ________ methods and get methods are also commonly called ________ methods.
A.
B.
C.
D.
15.   Java programmers do not focus on:
A.
B.
C.
D.
16.  Which of the following is false?
A.
B.
C.
D.
17.   The import declaration import *; ________.
A.
B.
C.
D.
18.  8.2 Q1: The _________ of a class are also called the public services or the public interface that the class provides to its clients.
A.
B.
C.
D.
19.   The term “information hiding” refers to:
A.
B.
C.
D.
20.   By default, the classpath consists only of the ________. However, the classpath can be modified by providing the ________ option to the javac compiler.
A.
B.
C.
D.
21.  When should a program explicitly use the this reference?
A.
B.
C.
D.
22.  Which of the following statements is true?
A.
B.
C.
D.
23.   A constructor cannot:
A.
B.
C.
D.
24.  A final field should also be declared ________ if it is initialized in its declaration.
A.
B.
C.
D.
25.  Using public set methods provides data integrity if:
A.
B.
C.
D.
26.  Abstract Data Types:
A.
B.
C.
D.
27.  8.5 Q2: Constructors:
A.
B.
C.
D.
28.   Which statement is false?
A.
B.
C.
D.
29.   A programmer-defined constructor that has no arguments is called a ________.
A.
B.
C.
D.
30.   Which syntax imports all static members of class Math?
A.
B.
C.
D.
31.  The static method ________ of class String returns a formatted String.
A.
B.
C.
D.
32.   What happens when this is used in a constructor’s body to call another constructor of the same class if that call is not the first statement in the constructor?
A.
B.
C.
D.
33.  Static class variables:
A.
B.
C.
D.
34.   Consider the statement    package com.deitel.jhtp6.ch08;    Which of the following is true?
A.
B.
C.
D.
35.  Which statement is false?
A.
B.
C.
D.
36.  When implementing a method, use the class’s set and get methods to access the class’s ________ data.
A.
B.
C.
D.
37.   Which of the following does not contribute to improved software reusability?
A.
B.
C.
D.
38.  When compiling a class in a package, the javac command-line option ________ causes the javac compiler to create appropriate directories based on the class’s package declaration.
A.
B.
C.
D.
Back to top

Removing ad is a premium feature

Upgrade and get a lot more done!
Take Another Quiz
We have sent an email with your new password.