Top 50+ Advanced OOPS Interview Questions for Freshers Pdf 2020-21 - 1

Question: 1

What is encapsulation?

Encapsulation is binding of attributes and behaviors. Hiding the actual implementation and exposing the functionality of any object.

Encapsulation is the first step towards OOPS, is the procedure of covering up of data and functions into a single unit (called class).

Its main aim is to protect the data from out side world.

Question: 2

What is shadowing?

When the method is defined as Final/sealed in base class and not override able and we need to provide different implementation for the same.

This process is known as shadowing, uses shadows/new keyword.

Question: 3

What is an abstract class?

  • An abstract class is a special kind of class that cannot be instantiated.
  • It normally contains one or more abstract methods or abstract properties.
  • It provides body to a class.

Question: 4

What is an interface?

An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body.

Question: 5

How a base class method is hidden?

Hiding a base class method by declaring a method in derived class with keyword new. This will override the base class method and old method will be suppressed.

Related Questions