I have a code in which i am comparing a float with == operator
String sFloat = "0.0";
float n = Float.parseFloat(sFloat);
System.out.println("n--"+n);
if(n == 0){
System.out.println("inside if");
}
else{
System.out.println("inside else");
}
is the above way is the right to compare float or it will fail in other case . like .equals or any other method .
float is a primitive variable not Float
I do not want to use wrapper Float. I want only the primitive comparision