Properties Example

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Properties;
public class PropertiesDemo1 
{
public static void main(String[] args) throws IOException 
{
	Properties p=new Properties();	
	p.load(new FileInputStream("D:\\Project1\\my.properties"));
	Enumeration e1=p.propertyNames();
	while(e1.hasMoreElements())
	{
		String name=e1.nextElement().toString();
		String value=p.getProperty(name);
		System.out.println("Name -"+name);
		System.out.println("Value -"+value);
		System.out.println("=============");
	}
}
}

Download

Collections in Java

ArrayList Example
HashMap Example
HashTable Example
Array Sort
Read Properties File
Get System Properties


Write your Comment

Name :
Email Id : [ We will not publish your email id ]
Your Comment : [ Maximum 200 chars ]
Enter Security code