Can a method be overloaded based on different return type but same argument type ?


No, because the methods can be called without using their return type in which case there is ambiquity for the compiler.



Explore posts in the same categories: Object Oriented Interview Questions


BOOKMARK THIS : del.icio.us | Digg it | Furl | reddit |


Related Questions :

  • What is overloading??
  • With the C++ language, you can overload functions and operators. Overloading is the practice of supplying more than one definition...
  • What is Overriding?
  • To override a method, a subclass of the class that originally declared the method must declare a method with the...
  • What is the argument type of a program’s main() method?
  • A program's main() method takes an argument of the String[] type....
  • What is the argument type of a program’s main() method?
  • A program's main() method takes an argument of the String[] type....
  • What restrictions are placed on method overriding?
  • Overridden methods must have the same name, argument list, and return type. The overriding method may not limit the access of...
  • What is the difference between a copy constructor and an overloaded assignment operator?
  • A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns...
  • When are temporary variables created by C++ compiler?
  • Provided that function parameter is a "const reference", compiler generates temporary variable in following 2 ways. a) The actual argument is the...
  • What is a conversion constructor?
  • A constructor that accepts one argument of a different type. The compiler uses this idiom as one way to infer conversion...
  • What is the return type of a program’s main() method?
  • A program's main() method has a void return type....
  • Basic Java Interview Questions
  • What if the main method is declared as private?The program compiles properly but at runtime it will give "Main method...

    Comment:

    You must be logged in to post a comment.