Recent questions tagged oop-principles

Description : Name any two OOP’s principles.

Last Answer : Ans. The OOPs principles are Encapsulation Abstraction Polymorphism Inheritance

Description : Define Encapsulation.

Last Answer : Ans. Encapsulation is the process of bundling state (instance variables) and behaviour (methods) is a single unit (class).

Description : Why is an object called an instance of a class?

Last Answer : Ans. An object is called an instance of a class as every object created from a class gets its own instances of the variables defined in the class. Multiple objects can be created from the same class.

Description : Name any two OOP’s principles.

Last Answer : Ans. The OOPs principles are Encapsulation Abstraction Polymorphism Inheritance

Description : Define polymorphism

Last Answer : The word polymorphism means having many forms. In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form. Real life example of polymorphism: A person ... different characteristic. Like a man at the same time is a father, a husband, an employee.

Description : Define Encapsulation.

Last Answer : Encapsulation is one of the fundamentals of OOP (object-oriented programming). The process of binding data (instance variables) and corresponding methods (behaviour) together into a single unit ... class only that binds variables and methods together and hides their complexity from other classes.

Description : What is Inheritance ?

Last Answer : Inheritance is the capability of one class to inherit capabilities or properties from another class in Java. For instance, we are humans. We inherit certain properties from the class 'Human' such as the ability to speak, breathe, eat, drink, etc. We can also take the example of cars.

Description : Define abstraction.

Last Answer : Ans. Abstraction means displaying only essential information and hiding the background details of the implementation. Real Life Example of Abstraction in Java. Abstraction shows only important things to the user and ... how it work? And also we do not know the internal functionality of a bike.

Description : Name any two basics Principle of Object-Oriented Programming.

Last Answer : Ans. Encapsulation and Polymorphism

To see more, click for the full list of questions or popular tags.