VOOZH about

URL: https://www.geeksforgeeks.org/java/properties-equalsvalue-method-in-java-with-examples/

⇱ Properties equals(value) method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Properties equals(value) method in Java with Examples

Last Updated : 11 Jul, 2025
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:
Output:
Current Properties: {3=1000RS, 2=500RS, 1=100RS}
Properties 2: {Book=500, Mobile=5000, Pen=10, Clothes=400}
Are both properties equal: false
References: https://docs.oracle.com/javase/9/docs/api/java/util/Properties.html#equals-java.lang.Object-
Comment