Prev Next

Java / OOPS Concepts and its implementation in Java

1. OOP.

Object Oriented programming is a type of programming paradigm where programs are treated as real-world objects. OOPS correlates a computer program into a real-world object....

Read full answer

2. Principles of OOP.

The below are the principles that attributes to the OOP behavior. Inheritance Abstraction Encapsulation Polymorphism Aggregation Composition Association

Read full answer

3. Open closed principle.

In object oriented programming world, the open-closed principle states that the software components classes, methods etc should be open for extension but closed for modification. A class can allow its behavior to be extended without modifying its own behavior.

Read full answer

4. Difference between object oriented and object based language.

Object oriented language supports all the features/principles of OOP whereas object-based languages do not support all the features. e.g.

Read full answer

5. Define class.

A class is a blueprint/prototype or a template for creating different objects which define its properties and behaviors. Java class objects exhibit the properties and behaviors defined by its class....

Read full answer

6. Object.

"Object" refers to an instance of a class where the object can contain any combination of variables, functions.

Read full answer

7. Define a variable/data.

A variable holds or stores some data; one variable might be a color of car, another variable might be model.

Read full answer

8. Explain Diamond problem.

The diamond problem (a.k.a deadly diamond of death) refers to an ambiguity that brews due to allowing multiple inheritance. In Java, multiple inheritance is not allowed for classes and permitted only for interfaces to eliminates this serious issue.

Read full answer

9. SOLID principles of OOD (Object Oriented Design).

SOLID principles provide the specification for the design of a class to ensure high quality. There are five principles as each letter in SOLID represents one....

Read full answer

10. Why Java does not support operator overloading?

Operator overloading makes the code less readable and poorly maintainable. To maintain code simplicity, Java doesn't support operator overloading.

Read full answer

11. Differences Between Static Binding And Dynamic Binding In Java.

Static Binding. Dynamic Binding....

Read full answer

12. In a class, a method is overloaded and One form is declared static while another form is non-static. Is that method properly overloaded?

Yes. Compiler checks only method signature to validate if a particular method is overloaded or not.

Read full answer

13. What is Encapsulation in Java?

Encapsulation in Java is a concept that enforces protecting variables, functions from outside of class, in order to better manage that piece of code and having least impact or no impact on other parts of a program due to change...

Read full answer

14. Difference between data hiding and data abstraction in OOPS.

Data hiding is when the designer specifically decides to limit access to details of an implementation. Abstraction is when you are dealing with an aggregate, for example, a Car is an abstraction of details such as a Motor, Wheels, brake,...

Read full answer

15. Difference between abstraction and encapsulation in OOPS.

Abstraction deals with separating interface from implementation. Abstraction in java is achieved by using interface and abstract class.

Read full answer

16. Which of the Java OOPS feature promotes access protection or data hiding?

Encapsulation promotes access protection and data hiding.

Read full answer

17. Explain Liskov Substitution Principle (LSP).

The Liskov Substitution Principle is a concept in Object Oriented Programming that states: Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.

Read full answer

18. Explain cohesion and coupling in OOD.

Cohesion refers to what the class (or module) can do. High cohesion is preferred since it is focused on actions it can perform and limited....

Read full answer

«
»

Comments & Discussions