Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. class Test
  2. {
  3. public void m1(int x)
  4. {
  5. System.out.println(“int-arg”);
  6. }
  7. public void m1(int … y)
  8. {
  9. System.out.println(“var-arg”);
  10. }
  11. public static void main(String args[])
  12. {
  13. Test t = new Test();
  14. t.m1(10,10); ——>int-arg
  15. t.m1(); ——>var-arg
  16. t.m1(10); ——>int-arg
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement