Session getProperties Example
Session class getProperties example. This example shows you how to use getProperties method.
Session class getProperties example.public Properties getProperties() Returns the Properties object associated with this Session
Here is the code
/*
* @ # GetProperties.java
* A class repersenting use to GetProperties method
* of Session class in javax.mail package
* version 07 July 2008
* author Rose India
*/
package session;
import java.util.*;
import javax.mail.*;
public class GetProperties {
public static void main(String args[]) throws Exception {
Properties properties = System.getProperties();
Session session = Session.getDefaultInstance(properties, null);
Properties p = session.getProperties();
System.out.println("java.runtime.name : \n" +
p.getProperty("java.runtime.name"));
System.out.println("\nsun.boot.library.path : " +
p.getProperty("sun.boot.library.path"));
}
} |
Output
java.runtime.name :
Java(TM) SE Runtime Environment
sun.boot.library.path :
/usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386 |
|