Shortcut to generate Getter and Setter in Eclipse

What are Getter and setter methods ? Getter method is to retrieve the value of instance variable while a setter method is used to set or update the value of instance variable. It is a good practice to access instance variables through these methods instead of directly accessing because we can place some pre-conditions before … Read more

Local vs Instance vs Class vs Reference variable in Java

In Java we have 4 type of variables :- Local Variable Instance Variable Class variable Reference variable Java developers often get confused while using these terms, let us understand the difference between them in detail : Local Variable Local variables are those which are defined inside a block, method or constructor. These variables get destroyed … Read more

Parameterized Constructor in Java

Parameterized constructor can be made by the user if they want to assign some value to instance variable at time of creation of object. Parameterized constructors are also a good way to perform some operations that are to be performed at the start such as Database connections, pre-checks on values of instance variables or certain … Read more