For eg:-
my Properties file contains the following data:
user=system
user=oracle
user=xyz .
And I write the following code:-
import java.util.*;
import java.io.*;
public class Test
{
public static void main(String[] args)throws Exception
FileReader reader=new FileReader("db.properties");
Properties p=new Properties();
p.load(reader);
System.out.println(p.getProperty("user"));
}
}
The output I get is xyz.
How to get all the values as an output ?