3:31 pm - Sunday June 25, 2017

To list out to the specified output stream using list(PrintStream out) 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 list out to the specified output using list(PrintWriter out) method.Properties list(PrintWriter out) prints this property list out to the specified output stream.


import java.io.PrintWriter;

import java.util.Properties;

public class PropertyListPrintWriter

{

	public static void main(String[] args)

	{

		Properties prop = new Properties();

		PrintWriter writer = new PrintWriter(System.out);

		prop.put("Chapter Count", "200");

		prop.put("Tutorial Count", "150");

		prop.put("tutorial", "java2s.com");

		prop.put("Runnable", "true");

		prop.list(writer);

		writer.flush();

	}

}

Output

– listing properties –

Chapter Count=200

Tutorial Count=150

Runnable=true

tutorial=java2s.com

BACK

Filed in: Java Examples

Comments are closed.