Java Program with variable declaration