OOP Concepts and Pillars Flashcards

1
Q

What is an Access Modifier?

A

An access modifier defines the access type of the method

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

What does the ‘Public’ access modifier do?

A

Makes the method accessible in all classes in your application

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

What does the ‘Protected’ access modifier do?

A

Makes the method accessible within the package which it is defined and in its subclasses (including subclasses declared outside of the package)

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

What does the ‘Private’ access modifier do?

A

makes the method accessible only within the class in which it is defined

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

What does the default access modifier do?

A

the default access modifier makes the method accessible within the same class and package in which its class is defined

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

When is the default access modifier applied to a method?

A

when a method is declared or defined without specifying any modifier, the default is applied.

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

What is a return type?

A

The data type of the value returned by the method.

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

What is the return type of a method that does not return a value?

A

void

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

What is parameter list syntax?

A

A comma separated list of the input parameters are defined, preceded with their data type, within the closed parentheses().

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

What is a superclass?

A

The class from which the subclass is derived. Also known as a parent class or base class

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

How many interfaces can a class implement?

A
  • More than one

- up to 65535 interfaces

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

An object consists of 3 things. What are they?

A

State, behavior, and identity

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

What is the state of an object?

A

It is represented by the attributes and properties of an object.

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

What is the behavior of an object represented by?

A

it is represented by the methods of an object. It also reflects the response of an object with other objects

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

What is the identity of an object?

A

a unique name of the object that enables one object to interact with other objects

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

What does it mean to instantiate something in Java?

A
Declaring objects
When an object of a class is created, the class is said to be instantiated.
17
Q

What is the minimum number of constructors all classes have?

A

all classes have at least 1 constructor. if it is not declared, the Java compiler automatically provides a no-argument constructor (default constructor)

18
Q

What is Abstraction?

A

hiding the implementation details of an operations for the sake of simplifying the view for the end user. It separates needed functionality and implementation details