OBJECT ORIENTED PROGRAMMING Flashcards

1
Q

2 aspects of OOP

A

classes

objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Class is

A

a template

the parent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Object is

A
an instance of a class
the child
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Objects inherit

A
class methods
class variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Create a Class

A

Use Class keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Create an Object

A

specify Class name
followed by Object name
= ‘new’ keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Class Members are

A

fields & methods inside an object
use (.) syntax to create an object of the class
myObj.color

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Multiple Classes for

A

Good organisation
fields
methods
execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Access Modifier is

A

public keyword

makes fields of one Class accessible for other classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Constructor is

A

special method

initializes objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Constructor used

A

called when an object of a class is created

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Constructor advantages

A

save time

efficient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Access Modifiers

A
set access level and visibility for 
classes
fields
methods
properties
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Public

A

all classes access

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Private

A

code only accessible within the same class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Protected

A

code accessible within same or inherited class

17
Q

Internal

A

code accessible within its own assembly

18
Q

Encapsulation is

A

ensures sensitive data is hidden

19
Q

Encapsulation how

A

Properties
declare fields/variables private
provide public, get, set, methods

20
Q

Properties do

A
access private variables outside of a private class
Uses get & set methods for this
21
Q

Abstraction is

A

hiding certain details from user

a restricted class

22
Q

Abstract method

A
only used in Abstract class
uses body of derived class -that it inherited from
23
Q

Override is

A

keyword that overrides the base class method

24
Q

Encapsulation is

A

an object’s ability to hide data and behaviour

25
Q

Encapsulation does

A

enables a group of properties, methods, fields to be considered a single unit