Properties hashCode() in Java

hashCode(): This method is available in java.util.Properties class of Java.

Syntax:

int java.util.Properties.hashCode()

This method returns the hash code value for this Map.

Parameters: NA

Returns: the hash code value for this map.

Exceptions: NA

Approach

Java

import java.util.Properties;

public class PropertieshashCode {
    public static void main(String[] args) {

        Properties properties = new Properties();

        properties.put("Hello", "World");
        properties.put("C++", "Program");
        properties.put("Java", "Program");

        System.out.println(properties.hashCode());
    }
}

Output:

-1568447891


No comments:

Post a Comment