A. properties File Content
Usename = the path to the temple
Passwords = Tsinghua University City
Java code ::
Package P;
Import java. Io. ioexception;
Import java. Io. inputstream;
Import java. util. properties;
Public class pro {
Private Static Properties pro = new properties ();
Public static void main (string [] ARGs ){
Inputstream in = new Pro (). getclass (). getclassloader (). getresourceasstream ("P/a. properties ");
// Path
Try {
Pro. Load (in );
} Catch (ioexception e ){
// Todo auto-generated Catch Block
System. Out. println ("error !! ");
}
System. out. println ("name:" + pro. getproperty ("passwords") + "========================" + pro. getproperty ("usename "));
System. Out. println ("Password:" + pro. getproperty ("usename "));
System. out. println ("when no content exists" + pro. getproperty ("NONE", "1223"); // If NO content exists, the second parameter is displayed, that is, "1223"
}
}