OBJECT ORIENTED PROGRAMMING Flashcards
1
Q
2 aspects of OOP
A
classes
objects
2
Q
Class is
A
a template
the parent
3
Q
Object is
A
an instance of a class the child
4
Q
Objects inherit
A
class methods class variables
5
Q
Create a Class
A
Use Class keyword
6
Q
Create an Object
A
specify Class name
followed by Object name
= ‘new’ keyword
7
Q
Class Members are
A
fields & methods inside an object
use (.) syntax to create an object of the class
myObj.color
8
Q
Multiple Classes for
A
Good organisation
fields
methods
execution
9
Q
Access Modifier is
A
public keyword
makes fields of one Class accessible for other classes
10
Q
Constructor is
A
special method
initializes objects
11
Q
Constructor used
A
called when an object of a class is created
12
Q
Constructor advantages
A
save time
efficient
13
Q
Access Modifiers
A
set access level and visibility for classes fields methods properties
14
Q
Public
A
all classes access
15
Q
Private
A
code only accessible within the same class