I have
Object o = new Object()
o == o.clone(); //I understand this should be false since it's different two arraylist pointing to the same object right?
o.equals(o.clone()) //it's true if it's shallow copy since pointing at the same one
here equals isn't ==, it should be comparing hash code right? since it's object. source: equals method usage in string and list
but on my notes it says the equal method means == here.
is my notes wrong?
my note says the object class has aclone() method but it has an empty implementation, and an object of the object class is not allowed to invoke this method because of this reason.
Can someone please explain this b etter? I think I misunderstanding something