In java primitive variables will get its default value automatically after declaration. Then why it is mandatory to initialize a variable before using it.
When you declare a variable in Java, it is initialized with a default value according to the type of the variable. This is applicable only to instance and class variables which are declared inside a class and outside any method in the class. Local variables are not given default initial values which are declared inside a method. They must be initialized explicitly before they are used.
Initialization of a variable is to keep it free from any junk value.