If you want to check out if user has enter correct value, you should have a correct answer already.
For example: If the correct answer is 12.0 and the user input is [u]uvalue[/u] (which is a String)
You need to define a string with correct value: [u]ans[/u]="12.0"

if(ans.compareTo(uvalue)==0){// exactly the same

}else {// different string but might be correct value
double a,b;
a=new Double(ans).doubleValue(); //or  a= Double.parseDouble(ans);
b=new Double(uvalue).doubleValue(); // or  b=Double.parseDouble(uvalue);
if(Math.abs(a-b)<1.e-6){// same value but different digits or incorrect format

}else {// different value

}
}