Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean equals(Object f) {
- if(!f.instanceof(FIFO)) {
- throw new ClassCastException("Wrong class type");
- }
- if(this.size() != f.size())
- return false;
- for(int i=0; i<f.size(); i++) {
- if(this.get(i) == null && f.get(i) != null)
- return false;
- if(!this.get(i).equals(f.get(i)))
- return false;
- }
- return true;
- }
Add Comment
Please, Sign In to add comment