1:42 am - Wednesday February 22, 2017

To Return an enumeration of all the keys in this property list using Properties.propertyNames() 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 Return an enumeration of all the keys in this property list using Properties.propertyNames() method.Properties propertyNames() returns an enumeration of all the keys in this property list.


import java.util.Enumeration;

import java.util.Properties;

public class PropertyName

{

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

	{

		Properties prop = new Properties();

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

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

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

		Enumeration<?> enumeration = prop.propertyNames();

		System.out.println(enumeration.nextElement());

		System.out.println(enumeration.nextElement());

	}

}

Output

Chapter Count

Tutorial Count

BACK

Filed in: Java Examples

Comments are closed.