Question
In Java, which technique can be implemented using the private access specifier? a. Constructor Collection b. Encapsulation c. Garbage Collection d. None of the above.
In Java, which technique can be implemented using the private access specifier?
a. Constructor Collection
b. Encapsulation
c. Garbage Collection
d. None of the above.
In Java, which of the following allow us to define an IS-A relationship?
a. A class
b. An interface
c. a. and b.
d. None of the above.
Some graduate students updated the algorithm used by the submit server
and now testing a project takes 40% less time than before. We don't know
what the students did, only that testing takes less time now. This scenario
is an example of?
a. Data Abstraction
b. Procedural Abstraction
c. Efficient TA Execution
d. None of the above
Which of the following allow us to avoid code duplication?
a. Auxiliary(private) methods that several methods rely on.
b. Inheritance
c. a. and b.
d. Garbage Collection
e. None of the above.
In Java, a class can:
a. Extend only one class, and implement multiple interfaces.
b. Extend more than one class and implement multiple interfaces.
c. Extend only one class and implement only one interface.
d. None of the above.
Class A compiles, and has a single constructor that takes a string as parameter.
Class B extends class A. If "super()" is the first statement in the constructor
of class B, then:
a. B's constructor will compile.
b. We need to define a default constructor in class A in order for B's constructor
to compile.
c. We need to remove the "super()" from the class B's constructor for it to compile.
d. None of the above.
The Programmer class defines a method named "implement" that has the following
prototype:
protected String implement(int linesOfCode);
The JavaProgrammer class extends the Programmer class. Which of the following
is the prototype of a method in the JavaProgrammer class that OVERRIDES
the "implement" method of the Programmer class?
a. public String implement(int linesOfCode);
b. private String implement(int linesOfCode);
c. public String implement();
d. a. and b.
e. a. and c.
This question relies on the same information as the previous one. The
Programmer class defines a method named "implement" that has the following
prototype:
protected String implement(int linesOfCode);
The JavaProgrammer class extends the Programmer class. Which of the following
is the prototype of a method in the JavaProgrammer class that OVERLOADS (not
OVERRIDES as in the previous question) the "implement" method of the Programmer
class?
a. public String implement(int linesOfCode);
b. private String implement(int linesOfCode);
c. public String implement();
d. a. and b.
e. a. and c.
We can tell whether two objects belong EXACTLY to the same class by using:
a. The instanceof operator.
b. The getClass() method.
c. a. or b.
d. None of the above.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started