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

Java & Java Uses - thejavaconceptsparts

Buzzword in Java - thejavaconceptspart

Java Naming Conventions - thejavaconceptspart