Advantages of encapsulation in Java

Java 8Object Oriented ProgrammingProgramming

Major advantages of encapsulation in Java are following −

  • The fields of a class can be made read-only or write-only.
  • A class can have total control over what is stored in its fields.
raja
Updated on 17-Jun-2020 11:17:59

Advertisements