You don't seem to get input from the user anywhere in your program, and the compiler is smart enough to see that you're not giving x any value. Consider using a Scanner object for this.