| Author |
Error: float cannot be dereferenced
|
Rahul mir
Ranch Hand
Joined: Oct 31, 2012
Posts: 38
|
|
Hi,
please someone explane the error :
Error: float cannot be dereferenced, in the following code.
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
|
look at line 6 . you cant call method on primitives.
|
 |
Rahul mir
Ranch Hand
Joined: Oct 31, 2012
Posts: 38
|
|
|
ya, we can't call method on primitive .. but in error message, float cannot be dereferenced.. dereferenced thing i am not getting.
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
|
dereference - finding an appropriate object via reference. here you cant find object since float is a primitive, hence error.
|
 |
Rahul mir
Ranch Hand
Joined: Oct 31, 2012
Posts: 38
|
|
Ok, got it.. here equals method try to find the value of primitive type variable, from it's reference, that's why dereferenced error came..
thanks.
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
you are welcome
|
 |
 |
|
|
subject: Error: float cannot be dereferenced
|
|
|