Thursday, May 3, 2018

Output of the program [method overloading-ii]

Problem statement: 
  1. class MethodOverload {}

  2. class MethodOverloadExe2 {
  3. public void run(Object o) {
  4. System.out.println("object");
  5. }
  6. public void run(MethodOverload o) {
  7. System.out.println("user data type");
  8. }
  9. }
  10. public class OverloadingExe2 {
  11. public static void main(String[] args) {
  12. MethodOverloadExe2 m = new MethodOverloadExe2();
  13. m.run(null);
  14. }
  15. }
Output:
user data type

No comments:

Post a Comment

How to run standalone mock server on local laptop

 Please download the standalone wiremock server from Direct download section at the bottom of the page.  Download and installation Feel fre...