To check if an object is created from the specified class we can use the equals method .
To determine whether two variables or objects are equal in Java, use the equals method. A relational operator called == determines if two operands have values that are equal or not; if they are, the condition is said to be true. The method equals() in the Object class is used to determine whether two objects are equal.
When comparing two strings, the equals() method returns true if the strings are equal and false otherwise.
To compare two strings lexicographically, use the compare To() method.
To know more about equals method visit :
https://brainly.com/question/11721990
#SPJ4