GeeksforGeeks » Interview Questions

Amazon Interview Question for Software Engineer/Developer (2-5 Years) about Terminology

(4 posts)

Tags:

  1. monu
    guest
    Posted 1 year ago #

    describe the difference between final, finally and finalize in java

  2. seeker
    guest
    Posted 1 year ago #

    final --> constant
    finally --> the last block which gets executed before termination
    finalize --> method is called by the garbage collector when it determines no more references to the object exist

  3. Kumar
    Member
    Posted 1 year ago #

    finally is last block witch catches all exceptions during exception handling.

  4. JeanGrey
    guest
    Posted 1 year ago #

    Final class - > can't be extended
    Final variable -> the value can't be changed
    Final method ->can't be overridden
    Finalize is called up the Garbage Collector to destroy the object.(Can be called within the code even but doesn't guarantees the destruction of code)
    Finally -> Block which handles cleanup code(generally) after a try/catch block has been exectud


Reply

You must log in to post.

RSS feed for this topic