Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: close class

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default close class

    I need to close class instance at the end of code when not needed anymore ,haw can I do that

    --- Update ---

    it is a instance that run own threads and can be up to 3000 or more instances but I set threads limit to save pc so max 20-30 instances running and creating 50 by 50 instances but I'm having some bug that freeze app each time at about 240 instances 20-30 running but 240 instances opened maybe that cause freezing how can I self close each instance at the end of code please help


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: close class

    Setting an instance to null will nominate it for garbage collection.

Similar Threads

  1. Why can't I close my JFrame ?
    By bartolio in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 20th, 2013, 11:23 AM
  2. Close jframe
    By takamine in forum AWT / Java Swing
    Replies: 4
    Last Post: February 3rd, 2013, 02:16 PM
  3. Creating a close button
    By Zomby in forum Java Theory & Questions
    Replies: 13
    Last Post: October 17th, 2012, 04:13 AM
  4. Is this correct.Am I close? Help please
    By eagle09 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: June 26th, 2011, 07:26 AM
  5. Trying to add a close button
    By coyboss in forum Java Theory & Questions
    Replies: 5
    Last Post: February 12th, 2011, 03:28 PM