Okay so I have an assignment where I have to create a class with a set of private properties, which I have done. It gets tricky because I'm fairly new to java programming (or programming in general) and am not very practiced in encapsulation. I have not used getters/setters or constructors before. I understand the getter/setter methods, but have yet to understand any of the information online for constructors, or even understand their purpose.
I have to create getters/setters and constructors for each of the properties so it would seem I should learn to use these methods. If anyone could give me an example of a class with a constructor and explain what the constructor is doing, and why I would use it it would be nice.
Thank you ahead of time.