The following code:
age.equals( otherPerson.age 开发者_运维百科);
Produces a compile error like:
Cannot be dereferenced.
How do I fix this?
it's hard to tell from your minimalistic question, but i'll guess that age
is a primitive and therefore doesn't have any methods.
try using age == otherPerson.age
instead.
精彩评论