Results 1 to 6 of 6

Thread: can we call Finalize() ?

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Answers
    1

    can we call Finalize() ?

    can we call finalize()?


  2. #2
    Contributing Member
    Join Date
    Dec 2009
    Answers
    34

    Re: can we call Finalize() ?

    yes,we can and also you can use System.gc(); method


  3. #3
    Junior Member
    Join Date
    Feb 2009
    Answers
    5

    Re: can we call Finalize() ?

    ofcourse we can call finalize method, and System.gc() is also made for requesting the garbage collection...although System.gc() do not guarantee the garbage coolection.


  4. #4

    Re: can we call Finalize() ?

    yes we can call the garbage collection methods, but there is no guarantee that objected marked for garbage collection will be infact garbage collected.

    Ideally we should not do call or write logic based on garbage collection. It is the duty of the JVM to call this method.


  5. #5
    Expert Member
    Join Date
    May 2009
    Answers
    1,374

    Re: can we call Finalize() ?

    Quote Originally Posted by atnbhushan View Post
    can we call finalize()?
    Hi Friend,

    Yes. Nobody will stop us to call any method , if it is accessible in our class. But a garbage collector cannot call an object's finalize method if that object is reachable.

    Regards,
    Rijus.

    Real Inspirational Journey........Unanimously & Sincerely.

  6. #6
    Contributing Member
    Join Date
    Jan 2010
    Answers
    35

    Re: can we call Finalize() ?

    Yes you can call finalize(), but why you want to do something like this?

    Share the problem statement, we might provide you a solution... if you may allow us.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact