Reputation: 9134
I've noticed that the JAVA allows to use uninitialized instance variable but it blocks to use uninitialized local variables. I want to know why the language is saying so?
Note : This is not the first post of this kind. I've visited below questions too. But couldn't find the exact reason for WHY? This question may be a duplicate one of the following:
Upvotes: 2
Views: 1217
Reputation: 920
As I know,
Upvotes: 1
Reputation: 32468
I've noticed that the JAVA allows to use uninitialized instance variable.
No, the compiler initialize instance variables, if you don't initialize.
Upvotes: 1