public InputStream sendPostMessage() throws IOException{
return sendPostMessage(null); // 1
} public InputStream sendPostMessage(Properties args) throws IOException{ // 2
String argString="";
if(args !=null){ // 3
argString=toEncodedString(args);
}
URLConnection con=servlet.openConnection(); // 4 return con.getInputStream() ;
}1处调用sendPostMessage(null);其实就是调用方法2。在2中有args是否为null的判断,此时由于1调用2时传递参数为null,所以不执行3,直接执行4
不知这样说你是否明白
return sendPostMessage(null); // 1
} public InputStream sendPostMessage(Properties args) throws IOException{ // 2
String argString="";
if(args !=null){ // 3
argString=toEncodedString(args);
}
URLConnection con=servlet.openConnection(); // 4 return con.getInputStream() ;
}1处调用sendPostMessage(null);其实就是调用方法2。在2中有args是否为null的判断,此时由于1调用2时传递参数为null,所以不执行3,直接执行4
不知这样说你是否明白
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货