So I am trying to check if many strings are null and then throw an error for the one/ones that are. This is currently what I have right now except there are many more strings and I don't want to do this for all of them.
`String STRING_1, STRING_2, STRING_3, STRING_4 = null;
try (FileInputStream fileInputStream = new FileInputStream(PROPERTIES_FILENAME)) {
properties.load(fileInputStream);
STRING_1 = properties.getProperty("string1");
STRING_2 = properties.getProperty("string2");
STRING_3 = properties.getProperty("string3");
STRING_4 = properties.getProperty("string4");
if (STRING_1 == null || STRING_2 == null || STRING_3 == null || STRING_4 == null) {
System.err.println(STRING_1 == null ? "string1 is null!" : "");
System.err.println(STRING_2 == null ? "string2 is null!" : "");
System.err.println(STRING_3 == null ? "string3 is null!" : "");
System.err.println(STRING_4 == null ? "string4 is null!" : "");
System.exit(1);
}
}`