Why is the code below returning null
, instead of true
?
I can see that the property is being set based on the {TEST=true}
output.
Java code:
import java.util.Properties;
public class Test {
public static void main(String[] args) {
System.out.println("1");
Properties props = new Properties();
props.put("TEST", true);
System.out.println(props);
System.out.println(props.getProperty("TEST"));
System.out.println("2");
}
}
Program output:
1
{TEST=true}
null
2