+ 1
Need extra information about getters, setters and constructors
Hi, i am struggling to understand the getters setters and the use of constructors. Is there someone who could explain the use of these 3 in an easy way?
2 odpowiedzi
+ 5
Getters and setters for encapsulation
https://www.tutorialspoint.com/java/java_encapsulation.htm
Constructors use for initializing
https://beginnersbook.com/2013/03/constructors-in-java/
The best way to get a better understanding how these work is to practice hands on with your own code (remove bits of code/ add diffrent things / see the diffreneces in output) 😉👍