OOP Test Flashcards
What are the 3 parts of a class?
- Name 2. Static attributes 3. Dynamic behaviours
Static attributes
A variable that remains constant for all instantiations of the class. Cannot be changed at runtime
What is Instantiation?
Instantiation is the process of taking a class definition and creating an object that you can use in a program.
What is the Name?
The title of the class/object and what is is refered to.
Dynamic Behaviors
The pattern of state change over time is called the dynamic behaviour of a system
What is an instance?
A specific copy of an object
What is an object?
An object what is created after constructing a class. It is also the “type” variable.
What are constructors?
Constructors are used to initialize the instance of the object, which can determine its behaviour and assigned variables.
What are the 3 parts of a method signiture?
- body 2.parameters 3.return type
What is Polymorphism
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object. (Parent and Child classes)
What is information hiding?
Making the variables unacessable/private to other classes.
What is abstaction?
Through the process of abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency.
What is encapsulation?
Data encapsulation is the process of combining and assembling elements in order to create a new entity and the wrapping of private data into a class. Methods can be used to access the private data.
What does a UML diagram look like?