Reading property file

Hello
I have a property file:

PROP FILE:
Strength = Medium
Day = Thursday

------
I used the following code to read the property file
Properties props = new Properties();
            props.load( fis= new FileInputStream (new File ("file.properties")) );
---------
I just need to check if the "Strength" attribute in properties file is equal to "Medium" (java) and "Day" is equal to "Thursday", How do I check this using java code.

Thank you (Urgent response requested:)            
atwork2003Asked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
Typo

if ("Medium".equals(props.getProperty("Strength"))) {
}
0
 
CEHJCommented:
if ("Medium".equals(props.getProperty("Strength")) {
}
0
 
Ajay-SinghCommented:
try like this:
"Thursday".equals(props.getProperty("Day"));
0
 
atwork2003Author Commented:
Works. Great...Thanks:-)
0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.