2011年8月3日16:04:25
今天看到一段code
@Override
final protected LotteryResponse doInBackground(Void... params)
{
//code
}
问题:这点点点是什么意思?
解答:
参看自己的例子
public class TestVariousArgMethod {
public static void main(String arg[])
{
gen sample = new gen();
sample.show("china","america");
sample.show("china","america","1","2","3");
}
}
/** sample class with a various arguments method*/
class gen{
/** main logic method ,put the various arguments to screen*/
public void show(String...strings)
{
for(String str:strings)
{
System.out.print(str+"\t");
}
}
}
参数可变method,使用时会得到params一个数组,so easy!……^^