logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • How is final different from finally and finalize()?


  • Correct Answer
  • final is a modifier which can be applied to a class or a method or a variable final class can't be inherited, final method can't be overridden and final variable can't be changed finally is an exception handling code section which gets executed whether an exception is raised or not by the try block code segment finalize() is a method of Object class which will be executed by the JVM just before garbage collecting object to give a final chance for resource releasing activity 


  • Technology problems


    Search Results


    • 1. When will you define a method as static?
    • Discuss
    • 2. I do not want my class to be inherited by any other class. What should i do?
    • Discuss
    • 3. What is the purpose of declaring a variable as final?
    • Discuss
    • 4. Can a class be declared as protected?
    • Discuss
    • 5. Which package is imported by default?
    • Discuss
    • 6. 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
    • 7. 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
    • 8. Keeping the actoins and attributes together under a single unit is called

    • Options
    • A. Encapsulation
    • B. Information Hiding
    • C. Polymorphism
    • D. Inheritance
    • Discuss
    • 9. By whom will the unallocated memory that is no longer needed will be cleared in java?

    • Options
    • A. Java Virtual Machine
    • B. Garebage collector
    • C. Both A and B
    • D. None
    • Discuss
    • 10. What are the 3main tasks of JVM?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment