OnJava8-Examples/housekeeping/OverloadingVarargs3.java
2015-12-15 11:47:04 -08:00

22 lines
531 B
Java

// housekeeping/OverloadingVarargs3.java
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
public class OverloadingVarargs3 {
static void f(float i, Character... args) {
System.out.println("first");
}
static void f(char c, Character... args) {
System.out.println("second");
}
public static void main(String[] args) {
f(1, 'a');
f('a', 'b');
}
}
/* Output:
first
second
*/