Csci 2467 Final Exam Questions With Correct Answers
0 view 0 purchase
Course
CSCI 2467
Institution
CSCI 2467
Csci 2467 Final Exam Questions With
Correct Answers
OOP - answerprogrammers create classes to define new complex data types
Class - answera programmer defined data type. A class is a data type definition composed of
attributes (or fields, properties, or instance variables) consisting of primiti...
Csci 2467 Final Exam Questions With
Correct Answers
OOP - answer✔✔programmers create classes to define new complex data types
Class - answer✔✔a programmer defined data type. A class is a data type definition composed of
attributes (or fields, properties, or instance variables) consisting of primitive data types and
references to other class objects and methods that interact with these attributes.
object - answer✔✔a specific instance of a class. Can be created via the new operator
(instantiation)
instantiation - answer✔✔Process of creating an object, an instance of a class; creates space in
memory for the new object and binds a name for the object with the object's data in memory.
Object's attributes define what - answer✔✔the state of the object
Object's methods define what - answer✔✔the behavior of the object
A class consists of 3 parts - - answer✔✔1. name 2. attributes (primitives and/or references to
other class objects) 3. methods
Getters - answer✔✔Methods for obtaining the value of an object's attributes.
Setters - answer✔✔Methods for updating an object's attributes, but do not have a return value.
constructor - answer✔✔Used to create objects of a class
public method - answer✔✔visible to external classes
private method - answer✔✔only visible within the class it is defined
What is declared as private? What is declared as public? - answer✔✔Attributes are private,
constructors, getters, and setters are public.
Encapsulation - answer✔✔a fundamental principle of object-oriented programming, whereby the
internal components of a class are hidden from external classes and are only accessed via getter /
setter methods.
Why use encapsulation? - answer✔✔so that you can change the internal implementation of a
class without affecting other classes.
programming dependency - answer✔✔a class that you write that can be used by other
programmers.
Heap Memory - answer✔✔Global properties in an object and objects themselves are stored in
the "heap" area of a program's memory. Reference types are always on heap and it also has value
types
Stack Memory - answer✔✔Local method properties are stored in the "stack" area of memory.
Data must have a known, fixed size. Has value types
has-a relationship - answer✔✔association relationship between objects
is-a relationship - answer✔✔inheritance relationship between objects.
static variable - answer✔✔class variable and is shared by all instances of the class.
static method - answer✔✔class method, not associated with one particular object. Can be called
without having to create an instance of the class.
static methods can access... - answer✔✔static variables, but cannot access instance variables.
constants are usually declared as... - answer✔✔both static and final.
Immutable objects - answer✔✔Objects that cannot be changed once they are constructed.
- fields are initialized via a constructor
- all fields are private and final
- no setters
- all methods are final.
Subclass (derived class and child class) - answer✔✔inheriting class
superclass/base class/parent class - answer✔✔Inherited class
Polymorphism - answer✔✔providing a single interface to entities of different types
subtype polymorphism - answer✔✔methods written to operate on elements of a super type can
also operate on elements of a subtype.
Overriding the superclass method - answer✔✔a method in subclass with the same name and
signature as a method in the superclass
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Thebright. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $11.49. You're not tied to anything after your purchase.