The equals() method of java.util.concurrent.ConcurrentSkipListMap is an in-built function in Java which to check the equality of this Map object with the specified object. The method returns true if the given object is also a map of the previous one and the two maps have the same mappings.
Syntax:
public boolean equals(Object ob)
Parameter: The function accepts a single mandatory parameter ob which specifies object to be compared for equality with this map.
Return Value: The function returns true if the specified object is equal to this map.
Below programs illustrate the above method:
Program 1:
// Java Program Demonstrate equals() // method of ConcurrentSkipListMap import java.util.concurrent.*; class GFG { public static void main(String[] args) { // Initializing the map ConcurrentSkipListMap<Integer, Integer> mpp = new ConcurrentSkipListMap<Integer, Integer>(); // adding elements in map for (int i = 1; i <= 5; i++) mpp.put(i, i); // equals operation on map System.out.println(mpp.equals(4)); } } |
false
Program 2:
// Java Program Demonstrate equals() // method of ConcurrentSkipListMap import java.util.concurrent.*; class GFG { public static void main(String[] args) { // Initializing the map ConcurrentSkipListMap<Integer, Integer> mpp = new ConcurrentSkipListMap<Integer, Integer>(); // adding elements in map for (int i = 1; i <= 5; i++) mpp.put(i, i); // equals operation on map System.out.println(mpp.equals(3)); } } |
false
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
Recommended Posts:
- ConcurrentSkipListMap put() method in Java with Examples
- ConcurrentSkipListMap ceilingKey() method in Java with Examples
- ConcurrentSkipListMap clone() method in Java with Examples
- ConcurrentSkipListMap containsKey() method in Java with Examples
- ConcurrentSkipListMap containsValue() method in Java with Examples
- ConcurrentSkipListMap clear() method in Java with Examples
- ConcurrentSkipListMap remove() method in Java with Examples
- ConcurrentSkipListMap size() method in Java with Examples
- ConcurrentSkipListMap isEmpty() method in Java with Examples
- Set equals() method in Java with Examples
- Map equals() method in Java with Examples
- SimpleTimeZone equals() method in Java with Examples
- SortedSet equals() method in Java with Examples
- LocalDateTime equals() method in Java with Examples
- DateFormat equals() Method in Java with Examples
- FloatBuffer equals() method in Java with Examples
- LocalTime equals() method in Java with Examples
- Charset equals() method in Java with Examples
- ChronoZonedDateTime equals() method in Java with Examples
- Character.equals() method in Java with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

