logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • I do not want my class to be inherited by any other class. What should i do?


  • Correct Answer
  • You should declared your class as final But you can't define your class as final, if it is an abstract class A class declared as final can't be extended by any other class 


  • Technology problems


    Search Results


    • 1. What is the purpose of declaring a variable as final?
    • Discuss
    • 2. Can a class be declared as protected?
    • Discuss
    • 3. Which package is imported by default?
    • Discuss
    • 4. Can a source file contain more than one class declaration?
    • Discuss
    • 5. Does the order of public and static declaration matter in main() method?
    • Discuss
    • 6. When will you define a method as static?
    • Discuss
    • 7. How is final different from finally and finalize()?
    • Discuss
    • 8. Which king class properly represents the relationship "King has a best friend who is a Soldier"?

    • Options
    • A. class King extends Soldier { }
    • B. class King implements Soldier { }
    • C. class King { private BestFriend Soldier; }
    • D. class King { private Soldier bestFriend; }
    • Discuss
    • 9. How many of the following will follow JavaBean Listener naming rules? addListener addMouseListener deleteMouseListener removeMouseListener registerMouseListener

    • Options
    • A. 1
    • B. 2
    • C. 3
    • D. 4
    • Discuss
    • 10. Keeping the actoins and attributes together under a single unit is called

    • Options
    • A. Encapsulation
    • B. Information Hiding
    • C. Polymorphism
    • D. Inheritance
    • Discuss


    Comments

    There are no comments.

Enter a new Comment