logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • What are the restrictions when overriding a method ?


  • Correct Answer
  • Overridden methods must have the same name, argument list, and return type (ie, they must have the exact signature of the method we are going to override, including return type) The overriding method cannot be less visible than the method it overrides( ie, a public method cannot be override to private) The overriding method may not throw any exceptions that may not be thrown by the overridden method 


  • Technology problems


    Search Results


    • 1. Can we compile a java program without main?
    • Discuss
    • 2. What is inheritance?
    • Discuss
    • 3. What is encapsulation?
    • Discuss
    • 4. What is the security mechanism used in java?
    • Discuss
    • 5. What is diamond problem?
    • Discuss
    • 6. What is difference between Path and Classpath?
    • Discuss
    • 7. What is the impact of declaring a method as final?
    • Discuss
    • 8. What is static initializer block? What is its use?
    • Discuss
    • 9. How does a try statement determine which catch clause should be used to handle an exception?
    • Discuss
    • 10. What are the the different ways for creating a thread?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment