Java Exam 2025 Questions and
Answers
Which of the following statements about abstract superclasses is true? - ANSWER✔✔-
abstract superclasses may contain data
To exit out of a loop completely, and resume the flow of control at the next line in the
method, use _____ - ANSWER✔✔-A break statement
Failure to prefix the superclass method name with the keyword super and a dot (.)
separator when referencing this superclass's method causes _______ - ANSWER✔✔-
infinite recursion
Which of the following is not one of the three general types of computer languages? -
ANSWER✔✔-Spoken languages
_______ models software in terms similar to those that people use to describe real-world
objects - ANSWER✔✔-Object-oriented design
When a subclass constructor calls its superclass constructor, what happens if the
superclass's constructor does not assign a value to an instance variable? - ANSWER✔✔-
, The program compiles and runs because the instance variables are initialized to their
default values
Which of the following is not a Java keyword? - ANSWER✔✔-next
Arrays are: - ANSWER✔✔-fixed-length entities
The default implementation of method clone of Object performs a____ - ANSWER✔✔-
shallow copy
Consider the abstract superclass below:
public abstract class Fooo
{
private int a;
public int b;
public Foo(int aVal, intbVal) { a = aVal; b = bVal; }
public abstract int calculate();
}
Any concrete subclass that extends class Foo: - ANSWER✔✔-Must implement a method
called calculate AND will not be able to access the instance variable 'a'
How many times is the body of the loop below executed?
Answers
Which of the following statements about abstract superclasses is true? - ANSWER✔✔-
abstract superclasses may contain data
To exit out of a loop completely, and resume the flow of control at the next line in the
method, use _____ - ANSWER✔✔-A break statement
Failure to prefix the superclass method name with the keyword super and a dot (.)
separator when referencing this superclass's method causes _______ - ANSWER✔✔-
infinite recursion
Which of the following is not one of the three general types of computer languages? -
ANSWER✔✔-Spoken languages
_______ models software in terms similar to those that people use to describe real-world
objects - ANSWER✔✔-Object-oriented design
When a subclass constructor calls its superclass constructor, what happens if the
superclass's constructor does not assign a value to an instance variable? - ANSWER✔✔-
, The program compiles and runs because the instance variables are initialized to their
default values
Which of the following is not a Java keyword? - ANSWER✔✔-next
Arrays are: - ANSWER✔✔-fixed-length entities
The default implementation of method clone of Object performs a____ - ANSWER✔✔-
shallow copy
Consider the abstract superclass below:
public abstract class Fooo
{
private int a;
public int b;
public Foo(int aVal, intbVal) { a = aVal; b = bVal; }
public abstract int calculate();
}
Any concrete subclass that extends class Foo: - ANSWER✔✔-Must implement a method
called calculate AND will not be able to access the instance variable 'a'
How many times is the body of the loop below executed?