Oop Flashcards

1
Q

What is OOPS?

A

OOPS is abbreviated as Object Oriented Programming system in which programs are considered as a collection of objects. Each object is nothing but an instance of a class.

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

Write basic concepts of OOPS

A

Abstraction.
Encapsulation.
Inheritance.
Polymorphism.

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

What is a class?

A

A class is simply a representation of a type of object. It is the blueprint/ plan/ template that describe the details of an object.

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

What is an object?

A

Object is termed as an instance of a class, and it has its own state, behavior and identity.

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

What is Encapsulation?

A

Encapsulation is an attribute of an object, and it contains all data which is hidden. That hidden data can be restricted to the members of that class.

Levels are Public,Protected, Private, Internal and Protected Internal.

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

What is Polymorphism?

A

polymorphism (from the Greek meaning “having multiple forms”) is the characteristic of being able to assign a different meaning or usage to something in different contexts - specifically, to allow an entity such as a variable, a function, or an object to have more than one form. There are several different kinds of polymorphism.

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

What is Inheritance?

A

The ability have a parent class give a child access to functions and variables

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

Define a constructor?

A

A method used to initialize a class, it has no return type and has the name of the class

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

Define Destructor?

A

A method is called when an object goes out of scope

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

What is a virtual class

A

A class than can be overridden

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

What is function overloading?

A

The ability to define functions with the same name but a different number of arguments and argument types. The function may also have a different return type but a different return type alone is not enough to make an overloaded function.

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

What is function overriding?

A

Function overriding is when a child class implements a function of a parent class replacing the functionality of the parent function

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

What is an abstract class?

A

An abstract class is a class that can’t be instantiated but can be inherited from. It can have both declared and implemented functions

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

What is a ternary operator?

A

The ternary operator is an operator that takes three arguments. The first argument is a comparison argument, the second is the result upon a true comparison, and the third is the result upon a false comparison

Bool ? AnswerIfTrue : AnswerIfFalse

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

What is the finalize method

A

The finalize method is a destructor. It can’t be called explicitly but is used by the garbage collector.

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

Types of parameters/arguements

A

Value
Ref
Out

17
Q

What is super keyword?

A

The super keyword is typically used in one of two situations. You can use it to explicitly call the base-class constructor with one or more arguments. You can also use it to access base-class members that have been overridden by the current class.