package overloading;

public class AmbiguousInvocation {

    public static void main(String[] args) {

        /*
         * Ambiguous invocation occurs when a method call can
         * match more than one overloaded method. This program
         * shows a demonstration of ambiguous invocation.
         * 
         * doThings(int, int) matches both methods!
         * - the arg 1 can be passed into double a via implicit casting
         * - the arg 2 can be passed into double b via implicit casting
         * so doThings(1, 2) could use either doThings(int, double) 
         * or doThings(double, int) - the JVM doesn't know which to use
         */

        // doThings(1, 2);

    }

    public static void doThings(int a, double b) {
        System.out.println("accepts int, then double");
    }

    public static void doThings(double a, int b) {
        System.out.println("accepts double, then int");
    }
}
