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
  • 166,747
  • 40
  • 210
  • 420
Lakshan
  • 1,314
  • 3
  • 8
  • 22

1 Answers1

3

You are missing creating a properties instance:

Properties properties = new Properties();
user7294900
  • 52,490
  • 20
  • 92
  • 189