100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

JAVA CH8 EXAMINATION QUESTIONS WITH CORRECT ANSWERS

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
12-09-2025
Written in
2025/2026

JAVA CH8 EXAMINATION QUESTIONS WITH CORRECT ANSWERS

Institution
JAVA
Course
JAVA









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
JAVA
Course
JAVA

Document information

Uploaded on
September 12, 2025
Number of pages
6
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

JAVA CH8 EXAMINATION
QUESTIONS WITH CORRECT
ANSWERS

8.9 Q1: enum types are implicitly ________ and enum constants are implicitly
________.
a. a. final, static.
b. b. static, static.
c. c. static, final.
d. d. final, final.
. - Answer- ANS: a. final, static

8.9 Q2: Which statement is false?
a. a. An enum declaration is a comma-separated list of enum constants and may
optionally include other components of traditional classes, such as constructors, fields
and methods.
b. b. Any attempt to create an object of an enum type with operator new results in a
compilation error.
c. c. An enum constructor cannot be overloaded.
d. d. An enum constructor can specify any number of parameters. - Answer- ANS: c. An
enum constructor cannot be overloaded.

8.9 Q3: Which method returns an array of the enum's constants?
a. a. values.
b. b. getValues.
c. c. constants.
d. d. getConstants. - Answer- ANS: a. values.

8.10 Q1: Which of the following is false?
a. a. Method finalize does not take parameters and has return type void.
b. b. Memory leaks using Java are rare because of automatic garbage collection.
c. c. Objects are marked for garbage collection by method finalize.
d. d. The garbage collector reclaims unused memory. - Answer- ANS: c. Objects are
marked for garbage collection by method finalize. (Objects are marked for garbage
collection when there are no more references to the object).

8.11 Q1: Static class variables:
a. a. are final.
b. b. are public.
c. c. are private.

, d. d. are shared by all objects of a class. - Answer- ANS: d. are shared by all objects of
a class.

8.11 Q2: Which of the following is false?
a. a. A static method must be used to access private static instance variables.
b. b. A static method has no this reference.
c. c. A static method can be accessed even when no objects of its class have been
instantiated.
d. d. A static method can call instance methods directly. - Answer- d. d. A static method
can call instance methods directly.

8.12 Q1: Which syntax imports all static members of class Math?
a. a. static import java.lang.Math.*.
b. b. import static java.lang.Math.*.
c. c. static import java.lang.Math.
d. d. import static java.lang.Math. - Answer- ANS: b. import static java.lang.Math.*.

8.13 Q1: Instance variables declared final do not or cannot:
a. a. Cause syntax errors if used as a left-hand value.
b. b. Be initialized.
c. c. Be modified.
d. d. None of the above. - Answer- ANS: c. Be modified.

8.13 Q2: A final field should also be declared ________ if it is initialized in its
declaration.
a. a. private.
b. b. public.
c. c. protected.
d. d. static. - Answer- ANS: d. static.

8.16 Q1: A package is:
a. a. A directory structure used to organize classes and interfaces.
b. b. A mechanism for software reuse.
c. c. A group of related classes and interfaces.
d. d. All of the above. - Answer- ANS: d. All of the above.

8.16 Q2: A class within a package must be declared public if
a. a. It will be used only by other classes in the same package.
b. b. It will be used by classes that are not in the same package.
c. c. It is in the same directory as the other classes in the package.
d. d. It has a unique name. - Answer- ANS: b. It will be used by classes that are not in
the same package. Classes outside the package cannot use a class if the class is not
declared public.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
wisdompoint chamberlain college of nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
114
Member since
2 year
Number of followers
66
Documents
5307
Last sold
1 week ago
Nursing Tec

3.7

16 reviews

5
6
4
3
3
5
2
0
1
2

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions