Sagarya Kulkarni wrote:but what 'dereferenced' means?
if i use a.equals(b), it returns true. why is it so?
Variables of non-primitive types in Java area really references to objects on the heap. A reference is a pointer: it tells the JVM where on the heap the object is stored. Dereferencing means: looking up the object from the reference. To call a method or access a member variable via a variable that refers to an object, the reference must be dereferenced - the JVM must find the object on the heap.
The type 'float' is a primitive type, it is not a reference, so it can't be dereferenced. You get this error because you are trying to call the equals() method on a float - you can't do that, because the variable is not an object, and doesn't have methods that you can call.