class OverloadingEx{ public void methodEx1(){ System.out.println("methodEx1()호출"); } public void methodEx1(int a){ System.out.println("methodEx1(int a)호출"); } public void methodEx1(double a){ System.out.println("methodEx1(double a)호출"); } } public class ExamEx50{ public static void main(String[] args){ OverloadingEx oe = new OverloadingEx(); oe.methodEx1(); oe.methodEx1(2); oe.methodEx1(2.0); } }
Java