Proprty file in JAVA

Property file in java is essential when your code required configuration more often , for e.g. data base details, output file path, passing arguments

try{

//Property File

Properties prop = new Properties();

try{

//Reading Properties file

//FileInputStream input = new FileInputStream(args[0]);// To take arguments @ runtime

FileInputStream input = new FileInputStream("ObjectDeployConfig.properties");

// load a properties file

prop.load(input);


}
catch(IOException I){

I.printStackTrace();


}

Comments

Popular Posts