Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 29 pages
Exam (elaborations)

C212 WRITTEN TEST CERTIFICATION PREP ACTUAL TEST WITH VERIFIED SOLUTIONS 100 PERCENT CORRECT

Document preview thumbnail
Preview 3 out of 29 pages

C212 WRITTEN TEST CERTIFICATION PREP ACTUAL TEST WITH VERIFIED SOLUTIONS 100 PERCENT CORRECT

Content preview

C212 WRITTEN TEST CERTIFICATION PREP
ACTUAL TEST WITH VERIFIED SOLUTIONS
100 PERCENT CORRECT

⩥ What is: mutual recursion?.
Answer: In a mutual recursion, a set of cooperating methods
calls each other repeatedly.


⩥ What is: backtracking?.
Answer: Backtracking is a problem solving technique that builds
up partial solutions that get increasingly closer to the goal. It
examines partial solutions, abandoning unsuitable ones and
returning to consider other candidates.


⩥ How many solutions are there altogether for the four queens
problem.
Answer: Two solutions.


⩥ How can you accidentally replicate instance variables from
the superclass?.
Answer: Since a subclass has no access to the private instance
variables of the superclass, when beginners get a compiler error,

,they commonly "solve" this issue by adding another instance
variable with the same name to the subclass. Sure, the
constructor now compiles, but it doesn't set the correct text! The
object now has two instance variables, both with the same name.
The constructor sets one of them, and the display method
displays the other. The correct solution is to access the instance
variable of the superclass through the public interface of the
superclass.


⩥ Where does the super/sub terminology come from?.
Answer: From set theory: subset and superset.


⩥ What is: accidental overloading?.
Answer: In Java, two methods can have the same name,
provided they differ in their parameter types. The Java compiler
considers them to be completely unrelated. We say that the
method name is overloaded. This is different from overriding,
where a subclass method provides an implementation of a
method whose parameter variables have the same types.


If you mean to override a method but use a parameter variable
with a different type, then you accidently introduce an
overloaded method.

, ⩥ Define: constructor chaining (automatic invocation of the
superclass constructor).
Answer: Unless specified otherwise, the subclass constructor
calls the superclass constructor with no arguments.


⩥ What is polymorphism?.
Answer: Polymorphism ("having multiple forms") allows us to
manipulate objects that share a set of tasks, even though the
tasks are executed in different ways.


⩥ Define: dynamic method lookup.
Answer: In Java, method calls are always determined by the
type of the actual object, not the type of variable containing the
object reference. This is called dynamic method lookup. It
allows us to treat objects of different classes in a uniform way.


⩥ Is the method call Math.sqrt(2) resolved through dynamic
method lookup?.
Answer: No. This is a static method of the Math class. There is
no implicit parameter object that could be used to dynamically
look up a method.


⩥ Define: abstract class(es).

Document information

Uploaded on
June 9, 2026
Number of pages
29
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
TopGradeInsider
4.1
(9)
Sold
130
Followers
2
Items
46214
Last sold
1 day ago


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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions