KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I know that private instance variables are accessed through their public getters and setters method. But when I generate constructors with the help of IDE, it initializes instance variables directly instead of initializing them through their setter methods. Q1. So should I change the IDE generated code for constructors to initialize those instance variables through their setter methods. Q2. If yes, then why IDE don't generate constructors code in that way? ============================= EDITED ======================================= I use Eclipse and Netbeans IDE It's a general question. But as asked by @Lords would the answer depends on whether our constructor is public or protected or package private or private?
Tags (comma-separated)
Save Edits
Cancel