3:11 pm - Sunday November 25, 8300

To create an empty property list with no default values Properties() constructor

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 create an empty property list with no default values Properties() constructor,Properties Properties() creates an empty property list with no default values.


import java.util.Properties;

public class PropertyConstructor

{

	public static void main(String[] args)

	{

		Properties p = new Properties();

		p.put("Height", "200");

		p.put("Width", "150");

		p.put("Scannable", "true");

		System.out.println("" + p.getProperty("Scannable"));

		System.out.println("" + p.getProperty("Width"));

	}

}

Output

 true

150

BACK

Filed in: Java Examples

Comments are closed.