public class Foo { public static void main(String[] args) { float f; System.out.println(f); } }
The print statement causes
Actually local variables are stored in stack.Hence there is a chance of taking any old value present for the local variable.It is a big challenge for security reason..Hence java says you have to initialise a local varible before use.