0

When load the properties file I get a java.lang.NullPointerException

This is a simple java swing application, try to read the properties file with following code get java.lang.NullPointerException:

InputStream inputStream;
Properties properties;

inputStream = new FileInputStream("C:/Config/config.properties");
properties.load(inputStream);
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Lakshan
  • 1,404
  • 3
  • 10
  • 23

1 Answers1

3

You are missing creating a properties instance:

Properties properties = new Properties();
Ori Marko
  • 56,308
  • 23
  • 131
  • 233