Session getInstance Example
Session class getInstance example. This example shows you how to use getInstance method.
Session class getInstance example. public static Session getInstance(Properties props) Get a new Session object.
Here is the code
/*
* @ # GetInstance.java
* A class repersenting use to GetInstance method
* of Session class in javax.mail package
* version 05 July 2008
* author Rose India
*/
package session;
import java.util.*;
import javax.mail.*;
public class GetInstance {
public static void main(String args[]) throws Exception {
Properties properties = System.getProperties();
Session session = Session.getInstance(properties);
System.out.println("Debug setting for this Session. " + session.getDebug());
}
} |
Output
| Debug setting for this Session. false |
|