blob: c32047ab6e2e3b1b312656d3ce26730f1d1df7e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
public class SimpleVarargs {
public SimpleVarargs(Integer... strings) {}
public void foo(Integer... strings) {
moo();
}
//public void bar(Integer[] array) { }
public void fooInt(int i,Integer... strings) {
moo();
}
private void moo() {}
//public void barInt(int i,Integer[] strings) {}
public static void main(String[] argv) {
SimpleVarargs s = new SimpleVarargs(new Integer(45));
s.foo(new Integer(45));
s.foo(new Integer(45),new Integer(45));
s.foo(new Integer[]{new Integer(45),new Integer(45)});
// s.bar(new Integer[]{new Integer(45),new Integer(45)});
s.fooInt(1,new Integer(45));
s.fooInt(2,new Integer(45),new Integer(45));
s.fooInt(3,new Integer[]{new Integer(45),new Integer(45)});
// s.barInt(4,new Integer[]{new Integer(45),new Integer(45)});
}
}
|