package overloading;

public class OverloadingExercise {

    public static void main(String[] args) {

        // determine the output from each statement, then run 
        // the program to check your answer
        printThings("hello", "world");
        printThings("hello", 1);
        printThings(5, 10);
        printThings(5, 10.0);

        // what's the problem with this one?
        //printThings(1.0, 1.5);

    }

    // version 1
    public static void printThings(String str1, String str2) {
        System.out.printf("%s and %s\n", str1, str2);    // h w
    }
    // version 2
    public static void printThings(int num1, double num2) {   // 5 10.0
        System.out.printf("%d and %f\n", num1, num2);
    }
    // version 3
    public static void printThings(int num1, int num2) {    // 5 10
        System.out.printf("%d and %d\n", num1, num2);
    }
    // version 4
    public static void printThings(String str1, double num1) {  // hello  5.0
        System.out.printf("%s and %f\n", str1, num1);
    }

}
