JAVA 2 - IMPORTANT Flashcards
1
Q
What are the four fundamental OOP concepts?
A
Encapsulation, Inheritance, Polymorphism, and abstraction.
2
Q
What is Encapsulation?
A
Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class. Therefore, it is also known as data hiding.