Why Use Getters/Setters Instead of Public Fields?
TLDR; Because it makes it easier to change our code later
Getters and setters are methods that are used to read/write an object's private field. They might not seem useful since you can achieve the same task with public fields, but they are useful be...
houssem.hashnode.dev4 min read