Initialization of variables in Java

  1. We have seen 4 kinds of variables:

  2. Each type of variables can be initialized at the moment that it is created.

    You have seen most of them already, we will complete and summarize it on this page for your convenience.


  3. Initializing Local variables:


  4. Initializing Parameter variables:


  5. Initializing Instance variables:


  6. Initializing static variables: