This example method use the Properties classes to load the property file. After extracting the property file the key value pair will add to the object of the Properties class.

Java Code:
import java.util.*;
import java.io.*;

public class LoadSample {
  public static void main(String args[]) throws Exception {
    Properties prop = new Properties();
    FileInputStream fis = 
      new FileInputStream("C:\\javaTips\\java.properties");
    prop.load(fis);
    prop.list(System.out);
    
    System.out.println(prop.keySet());
    System.out.println(prop.values());
    System.out.println("\nThe java property: " + prop.getProperty("java"));
      }
}