Problem statement:
- class MethodOverload {}
- class MethodOverloadExe2 {
- public void run(Object o) {
- System.out.println("object");
- }
- public void run(MethodOverload o) {
- System.out.println("user data type");
- }
- }
- public class OverloadingExe2 {
- public static void main(String[] args) {
- MethodOverloadExe2 m = new MethodOverloadExe2();
- m.run(null);
- }
- }
Output:
user data type
No comments:
Post a Comment