Reputation
Next privilege 200 Rep.
See reduced ads
Badges
5
Impact
0 people reached

  • 0 posts edited
  • 0 helpful flags
  • 1 vote cast
Sep
30
comment Why do arrays in Java not override equals()?
@Jules if you implement a recursive method, that's programming error and has nothing to do with equals or array equals.
Sep
28
comment Why do arrays in Java not override equals()?
@Snowman i'm unclear what you are saying. are you suggesting the folks that designed the Java language could never have made mistake, and the language itself is beyond reproach?
Sep
28
comment Why do arrays in Java not override equals()?
@Jules "what happens, then, if an Object array contains itself?" the same thing that happens if an object contains itself. if you implement a naive equals, then you'll get stack overflow.
Sep
24
awarded  Autobiographer
Sep
18
comment Why do arrays in Java not override equals()?
"What does equality mean in that case?"- um, how about that the arrays have to the same length, plus every object at every index in both the source and target must be equal according to the contract of equals()? seems like what you'd expect, and is the exact contract implemented by Arrays.equals().
Feb
22
awarded  Supporter
Mar
26
awarded  Scholar
Mar
24
awarded  Student
Dec
16
awarded  Teacher