when you ask a question related to error, please also post the error.
if w is not number, contains space or other char parseInt will throw exception. wrap that call with try catch. you still have issue with validating user.
try
if(u.compareTo(v) == 0) {
....
}
To assign literal string you can simply write
v = "your desired constant";
Please examine this code on your spare time you will find something interesting.
public static void main(String[] args) throws IOException, InterruptedException {
String x="000";
String y = new String("000");
String z = "000";
System.out.println(x==y);
System.out.println(x==z);
System.out.println(x.compareTo(y)==0);
System.out.println(x.equals(y));
}