The properties files are generally used as configuration file for java programs.In Java, there is a special class for manipulating properties file called java.util.Properites. Properties are configuration values managed as key and value pairs since it is basically a Hashtable that can be saved/loaded from stream. In each pair, both key and value are String values.

Example Program for Reading Properties File

import java.util.Properties;
class ReadProperties {
  public static void main(String arg[]) {
    try {
      Properties properties=new Properties();
      properties.load(new FileInputStream("D:\\"));
      System.out.println("Message from Properties file: "+ properties.getProperty("message"));   
    catch(Exception e) {

message=All The Best


Message from Properties file: All The Best