Hello, i have a simple question.
Let's say you have 3 private attributes.
If you want to insert a value you use a set method and when you wish to display its content you use a get method.
When you use a constructor with a parameter list e.g.:
private String attribute1;
private int attribute2;
private double attribute3;
Constructor(String attr1, int attr2, double attr3) {
attribute1 = attr1;
attribute2 = attr2;
attribute3 = attr3;
}
In the above case, the insertion of the values is made via the constructor and not the set method. So, is it false to add a value in the private attributes via the constructor and not via the set method?
Thank you for your time.