2:24 am - Tuesday March 28, 2017

To get specified key in the property list using GetProperty(String key)

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 get specified key in the property list using GetProperty(String key) method,Properties getProperty(String key) searches for the property with the specified key in this property list.


import java.lang.Object;

public class GetProperty

{

	public static void main(String[] args)

	{

		System.out.println(System.getProperty("user.dir"));

		System.out.println(System.getProperty("os.name"));

		System.out.println(System.getProperty("java.runtime.version"));

		System.out.println(System.getProperty("string", "defaultPassword"));

	}

}

Output

/home/mathan/Documents/workspace1/fileconcept

Linux

1.7.0_17-b02

defaultPassword

BACK

 

Filed in: Java Examples

Comments are closed.