Why local varial does't initialized by default while class variable may be?

Showing Answers 1 - 1 of 1 Answers

ajaykjha

  • Oct 16th, 2006
 

A constructor initializes an object immediately upon creation. If we do not explicitly define a constructor for a class, then java creates a default constructor for the class. The default constructor autometically initializes all instance variables to zero. So local variables doesn't initialized by default while class variable does.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions