What values are the default variables initialized to

  • Numbers are initialized to 0 or 0.0;
  • char - \u0000;
  • boolean - false;
  • Objects (including String) - null.

Read also:


Comments

Popular posts from this blog

ArrayList and LinkedList in Java, memory usage and speed

What characters can a variable name consist of (a valid identifier) in Java

Runtime data areas in Java