When comparing two objects, the equals method is used to return true if they are identical. Typically, this leads to the following code : The problem here is that whether intended or not, it is quite possible that the name value is null, in which case a null pointer exception would be thrown. A better […]

Continue Reading...