Properties void list(PrintStream out) method Example Program


Prints this property list out to the specified output stream. This method is useful for debugging.

Program

package com.candidjava;

import java.util.Properties;

/* 
 * @author : Mohan 
 * @description : The java.util.Properties.list(PrintStream out) method prints this property list out to the specified output stream. This method is useful for debugging. 
 */
public class PropertiesPrintStreamOut {
	public static void main(String[] args) {
		Properties prop = new Properties();

		// add some properties
		prop.put("Breadth", "600");
		prop.put("Length", "140");
		prop.put("Honesty", "true");

		// print the list with System.out
		prop.list(System.out);

	}
}

Output

-- listing properties --
Honesty=true
Length=140
Breadth=600

Explanation

public void list(PrintStream out)
Prints this property list out to the specified output stream. This method is useful for debugging.
Parameters:
out - an output stream.
Throws:
ClassCastException - if any key in this property list is not a string.


Related Post

Comments


©candidjava.com