Session类的构造器是私有的。您可以获得一个可被getDefaultInstance()方法共享的单一的默认会话: Properties props = new Properties(); // fill props with any information Session session = Session.getDefaultInstance(props, null); 或者,您可以用getInstance()方法创建一个独特的会话: Properties props = new Properties(); // fill props with any information Session session = Session.getInstance(props, null); 这两种情形下的null参数都是一种Authenticator对象,它不是在此时使用的。具体信息请参阅其后的“Autherticator”一节。