Sachin Tripathi wrote:...if we don't pass value through constructor or setting field by any method then getter will bring default value
Yes Sachin you are right.
But this is completely avoidable. You
MUST initialize each and every field of a class through either constructor or setter even if you are initializing the values to the default.
Getting default values without initialization may lead to unwanted errors.
As Campbell rightly said in his previous post
Campbell Ritchie wrote:You should never use the default values of fields. You should always initialise every field explicitly, even if it is to the same as the default value.