5
votes
4answers
532 views

Why do arrays in Java not override equals()?

I was working with a HashSet the other day, which has this written in the spec: [add()] adds the specified element e to this set if this set contains no element e2 such that (e==null ? e2==null : ...
1
vote
1answer
93 views

If a variable containing a function gave the function's return instead of a reference to the function, what would an array of functions return? [closed]

I'm creating a prototype scripting language similar to something like Javascript. In my language, every single reference to a variable is actually a function call (a getter function), whether it has ...
5
votes
6answers
850 views

why are both index[array] and array[index] valid in C?

For example consider: int index = 3; int array[4] = {0, 1, 2, 3}; then both index[array] and array[index] are valid expressions, much like *(index + array) and *(array + index). In C arrays why is ...