• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

CMSC132 - Final Exam Review(Corrrectly solved)

Document preview thumbnail
Preview 2 out of 8 pages

Subclasses correct answers - inherits all properties, behaviors, and fields of its superclass - inherits private fields and methods in its superclasses, but it cannot directly access them - can have more methods than its superclass - classes can only extend one superclass - subclass is a type of a superclass object - constructor automatically calls its superclass's default constructor (error if it doesn't have one) - can explicitly invoke its superclass constructor using super - execution order: most parent to most sub - can redefine (override) methods in a superclass, but must have the same name and signature - can call an overriden method in a superclass using super( ) - can define a field with the same name as a superclass field Superclasses correct answers - can refer to an object of any of its subclasses object-name instanceof classname correct answers - returns true if object is of the type classname or if is an object of any of its subclasses Class() correct answers - returns a reference to something called a class object (unique object for each class in program), which can be compared using == or equals() to see if object is the same class as another object Dynamic binding correct answers - the type of a object that a superclass reference refers to determines which method gets called (when methods are overridden) - DOES NOT APPLY TO STATIC METHODS Final correct answers - methods cannot be overridden by subclasses - classes cannot be extended (no subclasses) The Object class correct answers - the (direct/indirect) superclass of all other classes in Java - doesn't have fields, but it does have methods (equals( ) and toString( )) Interfaces correct answers - A collection of: ~ Constants ~ Method signatures (or prototypes), but no implementations - a class can only implement one interface at a time - Restriction of interfaces: CAN'T INSTANTIATE AN INTERFACE - Reference of an interface type object - an object of any class that implements the interface


Document information

Uploaded on
May 28, 2024
Number of pages
8
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$11.79

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.
Sold
23
Followers
6
Items
4026
Last sold
1 month 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

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