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

CMSC132 QUESTIONS AND ANSWERS FULLY SOLVED

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
23-06-2025
Written in
2024/2025

Exam of 7 pages for the course CMSC 132 at CMSC 132 (CMSC132)

Institution
CMSC 132
Course
CMSC 132









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

Written for

Institution
CMSC 132
Course
CMSC 132

Document information

Uploaded on
June 23, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CMSC132

Abstraction provides - answer high level model of activity

Procedural abstraction - answer Specifies actions performed
hides algorithms

Data abstraction - answer Specifies data objects for the problem
Hides implementations

Encapsulation - answer hides implementation details while providing interface
(methods) for data access
allows us to use code without knowing its implementation
makes debugging and code modification simple

Interface - answer Set of abstract methods
Specifies a contract for a class to implement

Class - answerimplements/defines contract

Collection - answergroups multiple elements into one object

Inheritance - answer- Process in which a derived class (subclass) is created from a
base class (superclass)
- inherits all the superclass methods and instance variables that are marked protected
or public
Creates a hierarchical structure for a group of objects, avoids code duplication

Shadowing - answerOverriding variables in subclasses

Inheritance and private - answerAll private data is inherited by subclasses
However, private members of a superclass cannot be accessed directly

When an object/method is marked protected it is accessible by... - answer- any
subclasses
- any class in the same package

The class Object has these methods... - answerequals(Object other)
toString()

Late (dynamic binding) - answermethod that is called depends on the objects actual
type, not the declared type of the reference variable
Java uses late binding

, Provides more flexibility

Overloading - answerWriting multiple methods of the same name with different number
of parameters/parameter types

Overriding - answerRedefining a method in a subclass

protected access modifier - answerOnly subclasses and classes in the same package
can access

No access modifier (package protected) means class that are _________ can access -
answerIn the same package

Early (static) binding - answermethod that is called depends on the declared type of the
reference variable
More efficient

Abstract class (what and why) - answerClass that cannot create an actual object
Used if logical values cannot be defined for instance variables
public class abstract Animal{
...}
Required if class contains an abstract method

Abstract method - answerProvides method signature
method that does not have any implementation
Why? every subclass will have method (implement in own way)
require abstract class
Cannot be final

What are 3 common uses of Interfaces? - answerPrimary purpose: specifying minimum
functional requirements for a class
Workaround for Java's lack of multiple inheritance
Rare: For defining groups of related symbolic constants

Rules for overriding methods regarding access specifier... - answerDerived class may
change the access specifier, but cannot decrease visibility

How do you disable overriding in derived classes - answerUse "final"

Inner classes (what and why) - answerClass defined in scope of another class
Outer/inner class can access all of each others methods and fields
Has an instance of the outer class object as soon as it is created

Nested Class (what and why) - answerSimilar to inner class but declared "static"
No linkage to outer class
Only access to static methods and fields of outer class

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.
Dreamer252 NBursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
478
Member since
2 year
Number of followers
293
Documents
21304
Last sold
1 week ago

4.0

115 reviews

5
60
4
22
3
18
2
2
1
13

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 exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT 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