The
equals(value) method of
Properties class is used to check for equality between two properties. It verifies whether the elements of one properties object passed as a parameter is equal to the elements of this properties or not.
Syntax:
public boolean equals(Object value)
Parameters: This method accepts a parameter
value of this Properties type and refers to the map whose equality is to be checked with this map.
Returns: This method returns a
boolean value stating if the equality holds for both the object Properties.
Below programs illustrate the equals(value) method:
Program 1:
Output:
Properties 1: {Book=500, Mobile=5000, Pen=10, Clothes=400}
Properties 2: {Book=500, Mobile=5000, Pen=10, Clothes=400}
Are both properties equal: true
Program 2: