• 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 1 out of 4 pages
Exam (elaborations)

EECS 280 Final Exam Fall '18 - Multiple Choice Questions and Graded Answers.

Document preview thumbnail
Preview 1 out of 4 pages

EECS 280 Final Exam Fall '18 - Multiple Choice Questions and Graded Answers.

Content preview

EECS 280 Final Exam Fall '18 - Multiple
Choice Questions and Graded Answers.
When should a virtual destructor be used? - When derived classes have member variables
that differ at all from the member variables of the base class.


Can you create an instance of an abstract class? - *No*; abstract classes are fundamentally
"incomplete" (they have no member variables) and you cannot declare instances of them.


Can you declare a pointer to an abstract class? - *Yes*, as long as the pointer is assigned
an instance of a derived class of the abstract class.
//Example: Animal *a = Gorilla &g;


If class B is declared within class A, which one is able to "give" friendship? - *Class B*;
only the class exposing its member variables may choose to give another class friendship.
"Friendship can be given but not taken."


Should template mechanism/typename code be written in .h files or .cpp files? - Should be
written in *.h* files; allows the compiler to see which functions might need to be overridden
with new typenames.


Are dynamic variables created on the heap or the stack? - Dynamic variables are always
created on the *heap*.


Which is ALWAYS legal in C++: upcasting or downcasting? - *Upcasting* is always
legal; downcasting is only legal in specific cases when using the dynamic_cast standard function.


//What is the proper way to delete the following //dynamic array allocation?

int *array = new int[size]; - *delete[ ] array;*

Document information

Uploaded on
September 4, 2025
Number of pages
4
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$3.49

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

Sold
0
Followers
0
Items
373
Last sold
-



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