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

CSE 1322 Lab and Lecture Final Exam Review Questions with 100% Actual correct answers | verified | latest update | Graded A+ | Already Passed | Complete Solution

Rating
-
Sold
1
Pages
21
Grade
A+
Uploaded on
26-06-2024
Written in
2023/2024

CSE 1322 Lab and Lecture Final Exam Review Questions with 100% Actual correct answers | verified | latest update | Graded A+ | Already Passed | Complete Solution

Institution
Course










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

Written for

Institution
Study
Course

Document information

Uploaded on
June 26, 2024
Number of pages
21
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CSE 1322 Lab and Lecture Final Exam Review
What is inheritance? - ANS-a fundamental principle of object-oriented programming. It allows a
class to "inherit" (behavior or characteristics) of another, more general class and it allows a new
class to "absorb" an existing class's members and it saves time by reusing proven and
debugged high-quality software

The class from which we inherit is referred to as - ANS-parent class or base class / super class

What does the keyword base indicate? - ANS-that the base class must be used allows access
to its methods, constructors and member variables. Using base(), we can call the constructor of
the base class. Using base.Method(...) we can invoke a method of the base class, pass
parameters to it and use its results. Using base.field we can get the value of a member variable
from the base class or assign a different one to it

When inheriting a class, - ANS-our constructors must call the base class constructor, so that it
can initialize its member variables.

The keyword protected: - ANS-defines class members which are not visible to users of the class
(those who initialize and use it), but are visible to all inheriting classes (descendants)

The keyword protected internal: - ANS-defines class members which are both internal, i.e.
visible within the entire assembly, and protected, i.e. not visible outside the assembly, but visible
to classes who inherit it (even outside the assembly)

When a base class is inherited: - ANS-All of its public, protected and protected internal
members (methods, properties, etc.) are visible to the inheriting class. - All of its private
methods, properties and member-variables are not visible to the inheriting class. - All of its
internal members are visible to the inheriting class, only if the base class and the inheriting class
are in the same assembly (the same Visual Studio project).

Downcasting - ANS-casting a superclass to a subclass

A method, which can be overridden, is called - ANS-virtual

What is the difference between overloading and overriding methods? - ANS-overloading is when
there are 2 methods with the same name but different parameters but overriding is when
inherited methods are being redefined in another class

The class with which inherit from the parent class is referred to as either one of these: - ANS-a
derived class, a sub class, or child class

,Can you instantiate an abstract class? - ANS-no

Polymorphism - ANS-where a variable is changing types while the program is running

What does inheritance allow? - ANS-a new class to "absorb" an existing class's members

How does inheritance save time? - ANS-by reusing proven and debugged high-quality software

UML - ANS-Unified Modeling Language

UML Diagram - ANS-graphical representation of relationship between classes and is used for
depicting objects and object oriented concepts

When should inheritance be used? - ANS-when classes are similar

What does inheritance support? - ANS-through an extended / derived class supports code
reuse.

A method override occurs when two methods in the same class have the exact same method
signature. True or False? - ANS-False

toString( )(Java) or ToString() (C#) is a method that is in the Object class that is inherited by all
Java / C# classes. True or False? - ANS-True

When a set of methods have the same name but different types/number of parameters in the
same class, they are called: - ANS-Overloaded methods

Abstract methods are used in defining - ANS-classes that need no methods implemented

he reserved word super (in Java) or base (in C#). <method name> is used call the method
which is defined in - ANS-the parent class

A class can inherit from the methods from its classes. - ANS-super, parent, abstract, or
interfaces

What is the goal of encapsulation? - ANS-To hide the values or state of a structured an object
inside a class, preventing unauthorized direct access to them

Since toString() is a method that is in the Object class, any call to the toString() method refers to
the toString( ) method in the Object class unless - ANS-specifically overridden in the child class

The unique feature of an abstract class is that - ANS-a subclass that extends it doesn't need to
have the abstract reserved word in its declaration.

, In a UML diagram, the arrows - ANS-point up to classes they inherit from

What does @Override do? - ANS-tells the compiler to check the override is correct

Equals(Object) Method - ANS-Determines whether the specified object is equal to the current
object.

Equals(Object, Object) Method - ANS-Determines whether the specified object instances are
considered equal.

Finalize( ) Method - ANS-- if you wish to execute code just before an object is destroyed by the
garbage collector, create a _______ method in the class and place the code there
- accepts no arguments
- void return type
Allows an object to try to free resources and perform other cleanup operations before it is
reclaimed by garbage collection.

GetHashCode( ) Method - ANS-Serves as the default hash function

GetType( ) Method - ANS-Gets the Type of the current instance

MemberwiseClone( ) Method - ANS-Creates a shallow copy of the current Object

ReferenceEquals(Object, Object) Method - ANS-Determines whether the specified Object
instances are the same instance

ToString( ) Method - ANS-Returns a string that represents the current object

clone( ) Method - ANS-makes a new object with the same state as an existing object and
creates and returns a copy of this object

equals​(Object obj) Method - ANS-Indicates whether some other object is "equal to" this one

getClass​( ) Method - ANS-Returns the runtime class of this Object

hashCode​( ) Method - ANS-Returns a hash code value for the object

notify( ) Method - ANS-Wakes up a single thread that is waiting on this object's monitor

notifyAll​( ) Method - ANS-Wakes up all threads that are waiting on this object's monitor

toString( ) Method - ANS-Returns a string representation of the object
$7.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

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.
DoctorHkane Havard School
Follow You need to be logged in order to follow users or courses
Sold
732
Member since
4 year
Number of followers
168
Documents
22476
Last sold
1 week ago

Explore my Stuvia collection for essential study aids: test banks, exams, summaries, and cases. With five years of expertise as an academic writer, I have honed my skills in crafting top-notch essays, exams, and research dissertations. My proficiency lies in producing well-structured and thoroughly researched content that meets academic standards. I am adept at handling various subjects and ensuring a seamless flow of ideas. Whether it's delivering compelling arguments in essays, creating challenging yet fair exam questions, or delving into in-depth research for dissertations, my experience equips me to excel in diverse academic writing tasks. I pride myself on meeting deadlines and maintaining the highest quality in every piece I produce. REACH ON iamnjokikelvin1@gmail

Read more Read less
4.6

386 reviews

5
308
4
29
3
21
2
10
1
18

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 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

Frequently asked questions