OPPS (Object Oriented Programming)

Things to learn in this concept
Hear the class dog act as a blueprint.
The variables those directly exist inside the class are called field variables.
The variables that exist inside the method of a class are called local variables.
Here dog1 and dog2 are the instance variables of the class Dog.

We have an idea about reference variables, objects and heap memory in the earlier classes. We have a detailed notes in the post methods.

Getter and Setter

These getters and setters are helpful when the field variables are private. Here if the string breed is set to private then we can't set dog1.breed=pub
For better understanding see the notes below.

Notes

Post a Comment

0 Comments