小弟看不懂这行,恳求帮助!
public class MailPing{
private static final int SMTP_PORT = 25;
public static void main(String[] args) {
String host = null;
String recipient = null;
String sender = null;
// 检查命令行参数
if (args.length < 1) {
System.out.println("Usage: MailPing 服务器 [收件人] [发件人]");
}
else {
host = args[0];
if (args.length >= 2) {
recipient = args[1];
}
if (args.length >= 3) {
sender = args[2];
}
if (sender == null) {
sender = recipient;
}
(new MailPing()).ping(host, recipient, sender);// <<===== 就这行
}
System.exit(0);
}
public void ping(String host, String recipient, String sender) {
………………
…………
……
用“(new MailPing())”是什么意思?
干吗不直接写ping(host, recipient, sender)?
谢谢!