Sunday, December 19, 2010

Java- Variables and default values

Class-level variables are implicitly initialized with default value.

Data Type Default Value (for fields)
byte 0
short 0
int 0
long 0L
float 0.0f
double 0.0d
char '\u0000'
String(or any object) null
boolean false

Local variables should be initialized before accessing as they are not implicitly
assigned with default value.


Post a Comment

Contact Form


Email *

Message *

The Insane Techie - Android App

Launched an android app for the blog on 07th June 2016. Get it from google play store... Tips for using the app Use in landscape mo...