12:19 pm - Sunday June 25, 2017

To Load a property list from the input character stream using Properties.load(Reader reader) method

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

BACK

This tutorial explains how to Load a property list from the input character stream using Properties.load(Reader reader) method.Properties load(Reader reader) reads a property list (key and element pairs) from the input character stream in a simple line-oriented format.


import java.io.StringReader;

import java.util.Properties;

public class PropertyLoad {

	public static void main(String[] args) throws Exception

	{

		Properties prop = new Properties();

		String s = "Chapter Count=200\nTutorial Count=15";

		StringReader reader = new StringReader(s);

		prop.load(reader);

		prop.list(System.out);

	}

}

Output

– listing properties –

Chapter=Count=200

Tutorial=Count=15

 

BACK

Filed in: Java Examples

Comments are closed.