fork download
  1. import java.util.Arrays;
  2.  
  3. class Example {
  4. void method(Object... args) {
  5. System.out.println(Arrays.toString(args));
  6. }
  7. public static void main(String[] args) {
  8. Example e = new Example();
  9. e.method(1, "foo", 2, "bar", 3);
  10. e.method(true, "foo", 'c', 'd', new Boolean(false), false);
  11. }
  12. }
Success #stdin #stdout 0.06s 32588KB
stdin
Standard input is empty
stdout
[1, foo, 2, bar, 3]
[true, foo, c, d, false, false]