views:

71

answers:

3

I'm pretty new to Java, so don't kill me :)

 FileInputStream files = new FileInputStream(path);
Properties  prop = new Properties();
        try {
            props.load(fis);
        .....

Let's say the files is:

Mary goes to school,
or,
not.

How can I see how the information was stocked inside the prop variable. I understand that every information, is stocked based on a key. How that key is selected?

A: 

That's not a properties file. A properties file would have to look like this:

name=Mary
place.she.goes=school

Then, the keys would be 'name' and 'place.she.goes'; corresponding values 'Mary' and 'school'.

M1EK
+2  A: 

Your example of a file is not a valid properties file. The format looks something like this:

key1=This is my value
key2=This is another value
key3=Yet another value

As you can see, the answer to your question is pretty obvious given the format.

More info here.

Asaph
A: 

I just saw the link gaven by Asaph. Thank you. Questions are answered.

cc
Please move this as a comment to Asaph's answer and delete this answer. Thank you.
Pascal Thivent