QuestionQ72

Working with Methods and Encapsulation

Which two capabilities can be implemented in a Java application by encapsulating the entity classes it uses?

Choose two
  • A data validation
  • B compile time polymorphism
  • C data hiding
  • D data abstraction
  • E data memory optimization
Explanation

Encapsulation restricts direct access to an object's fields, providing data hiding. It also centralizes controlled updates through constructors or setter methods, where validation rules can prevent invalid state.

Community Discussion

No comments yet. Be the first to start the discussion!