Java Encapsulation and Get or Set Methods - thejavaconceptspart

Java Encapsulation and Get or Set Methods - thejavaconceptspart

Java Encapsulation

The meaning of Encapsulation is to make sure that "sensitive data" is hidden from users. To achieve this you must.

  1. Declare class variables/attributes as private.
  2. Provide public get and set methods to access and update the volume of a private variable.

Get and Set Methods

The Get Methods returns the variable value get and set method sets the value.

Other Related Search

Please Leave a Comment Below⬇

Comments

Post a Comment

Remember to keep Comments Respectfully

Popular posts from this blog

Advantages of Object Oriented Programming - Learn Java - The Java Concepts

Java Naming Conventions - thejavaconceptspart

Advantage and Disadvantages of Top-down Programming - Learn Java - The Java Concepts Part