Created
January 27, 2015 10:40
-
-
Save kineticz/e7775f35957f7f3c1f0d to your computer and use it in GitHub Desktop.
Why do I have cast o into a IntList when it is already a IntList?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public boolean equals(Object o) { | |
| if(o == this) return true; | |
| if(!(o instanceof IntList)) return false; | |
| IntList that = (IntList) o; | |
| if(this.size != that.size) return false; | |
| for(int i = 0; i < this.size; i++) { | |
| if(this.data[i] != that.data[i]) return false; | |
| } | |
| return true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment