If a constructor is used in a program in Java is getter and setter still relevant to use?
Java programing language question
Yes, both have different use. Suppose in future you will add 10 attributes in your class then you have to overload the constructor. But if you have setter also you can set them.
Sunday Othniel Constructor is used to initial the attributes during creation of object. Where Setter are used to set the value of attributes after creation.
But what's the difference between getter, setter and constructor Raina Dhankhar ?