Can I call setter in constructor?

However, you can call getters and setters and any other methods inside a constructor provided you have done the proper initialization first before you call them.

Leave a Reply

Your email address will not be published. Required fields are marked *