Basic concepts in OOP Flashcards

1
Q

What is object oriented programming ?

A

A method of programming based on hierarchy of classes with well defined and cooperating objects
OR
A language model organized around objects
OR
A schematic paradigm for programming in which the linear concepts of procedures and tasks are replaced by the concepts of objects and message passing.

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

What is an object ?

A

An object is an executable copy of a class.
OR
It can be referred to as a new instance

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

What are the characteristics of objects ?

A

State

Behavior

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

How do you create an object ?

A
Create a class
Create a constructor 
Create the object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does an object store its states

A

In fields

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

How does an an object expose its behavior

A

through methods

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

How do objects communicate?

A

through methods that operate on an objects internal state.

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

What is a class?

A
A blueprint from which then individual objects can be created.
OR 
A class is a structure that defines the data and the methods to work on that data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the syntax of class

A
class CLASSNAME{
// constructor( )
{ }
// Object 
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a package

A

A namespace that organizes a set of related classes and interfaces.

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

What is an encapsulation

A

The concept that enables the hiding unnecessary details in classes and only providing a clear and simple interface for working with them.

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

What is inheritance?

A

This is a concept in OOP that enables new objects to take on the properties of existing objects.

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

What is a subclass/derived class?

A

A class that inherits from a superclass.

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

What is the base or superclass?

A

A class that is used as the basis for inheritance.

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

Example

A
class Student {
int studentID;
String emailAddress;
String name;
String sex;
Date D.O.B;
string course;
} 
class UndergraduateStudent extends Student{
String mentor;
string degreeCourse;
int numberOfMajors;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is abstraction?

A

Abstraction is the process of extracting common features from specific examples.
OR
Abstraction is a process of defining the essential concepts while ignoring the inessential details.

17
Q

What are the different types of abstraction?

A

Data Abstraction
Functional Abstraction
Object Abstraction

18
Q

What is polymorphism?

A

This is the ability to present the same interface differing underlying forms

19
Q

What are the two common types of polymorphism in OOP?

A

Method Overloading

Method overriding

20
Q

What is garbage collection?

A

This is a form of automatic memory management whereby the garbage collector attempts to reclaim garbage or memory occupied by the objects that are no longer in use by the program.

21
Q

What are variables?

A

This is a container that holds values that are used in a program.

22
Q

what are the types of variables in java?

A
Instance variables 
class variables 
local variable 
parameters
23
Q

What is an instance variable?

A

Non-static fields are also known as instance variables because their values are unique to each instance of a class (object)

24
Q

What is a class variable?

A

This is a field declared with the static modifier

25
Q

What is a local variable

A

These are variables declared within a method.

26
Q

What are parameters?

A

These are the variables found within the parenthesis.