How finalize program works

My question is how to make this finalize method to return "garbage collected" since the 3 object below is eligible for garbage collection.
Did i overriden the finalize method incorrectly or my code problem.
Kindly assist...
     public class Test {
     protected void finalize() throws Throwable
     {         System.out.println("Garbage collected");
     super.finalize();}
public static void main (String args[])
     {   for (int i = 0 ;i < 100000 ;i++)
     Test a = new Test();
     Object o =new Object();
     Object oa[] = new Object[1];
     o = null;
     oa = null;
     a = null;
     return ;
     }      }

You are right , i never think about my OS memory issue .....Tq for your perfect answer ,but anyway it is very difficult to make finalize work using my own coding cause "DR watson " Error will prompt me first before the code run if try to do force allocate of all the memory resources.
Anyway how about this question.
Question : Which line is the eligible for garbage collection.
1.public class Test
2.{       public static void main (String args[])
3.     {
4.     String s1 = "One";
5.     String s2 = "Two";
6.     s2+=s1;
7.     s1=null;
8.     s1=s2;
9.     System.out.println(s1);
10.     }
11.}
A.Before line 7
B.Before line 8
C.Before line 9
D.Before line 10
E.Before line 5

Similar Messages

  • How the program work ???

    hi everyont i am doubt about how the program work???
    public class TestClone implements Cloneable{
         int count;
         TestClone next;
         public TestClone(int count){
              this.count=count;
              if(count>0)
              next=new TestClone(count-1);
         void add(){         
         count++;
         if(next!=null) // how it can loop and
         next.count++; //execution next.count++ ??
         public String toString(){    // from the result  the object execut  the method  automatic, but i think  it isnot  definite as static ,it cannot execut
              String s=String.valueOf(count)+"";
              if(next!=null) //the same question as about
              s+=next.toString();
              return s;
         public Object clone(){
              Object o=null;
              try{
                   o=super.clone();
                   }catch(Exception e)
                   {System.out.println("cannot clone");}
                   return o;
    public static void main(String []args){
         TestClone c=new TestClone(5);
         System.out.println("c="+c);
    //the result is 5 4 3 2 1 0
    //c is object why it can print out
         TestClone cl=(TestClone)c.clone();
         System.out.println("c="+c);
         c.add();
         System.out.println("after added\nc="+c+"\ncl="+"cl");
    //the result is 6 5 3 2 1 0 but where is 4 ??
    // 5 4 3 2 1 0
         }     }

    Is this your code? What do you WANT it to do? What's the purpose?
    Thanks!
    -Zach

  • Round trip workflow with proxies between Premiere and AE / a more general question about how these programs work?

    Hi all,
    I'm new to editing with proxies in Premiere and have some questions about how to handle the relationship with After Effects. Say I have a rough cut (with proxies) and I want to send it to AE to do some effects. The simplest thing to do seems to be to replace the proxies with the originals in Premiere, send the project to AE and do my thing. But if I then want to send the project back to Premiere, it will involve the original files, which are too machine-intensive for me to edit. In theory, it seems like there should be a way to send the project with original footage to AE, do effects, send it back to Premiere, and then replace it with proxies to do further editing while retaining the effects.
    This leads to a confusion about how AE works. When I do an effect, am I correct in assuming that it does nothing to the original file? If that's the case, it seems like it shouldn't matter (in the editing stage) what file AE "applies" an effect to (proxy or original). But I feel like there's a hitch in this workflow. The same question could also be asked about going back and forth in Speed Grade.
    Perhaps there is no real answer to this and the best option is to save effects and grading for after I have picture lock, but sometimes that's not entirely possible or convenient, etc.
    Hopefully this makes some sense—It's a little hard to explain.
    Thanks.

    Hi Mark,
    Here are the specific sections of the manual that should give you the best explanation regarding the Check out/in workflow for FCP projects in Final Cut Server:
    Check out:
    http://documentation.apple.com/en/finalcutserver/usermanual/#chapter=7%26section =5
    Editing:
    http://documentation.apple.com/en/finalcutserver/usermanual/#chapter=7%26section =6
    Check in:
    http://documentation.apple.com/en/finalcutserver/usermanual/#chapter=7%26section =7
    -Daniel

  • Could somebody tell me how this program works....

    Hi, I am new in Java...I just bought a book and start to learn the java from that book. Here is one of the project exercise and seems that it is difficult for me to understand the flow of the program.
    class HelpClassDemo {
    public static void main(String args [])
    throws java.io.IOException () {
    char choice;
    Help hlpobj = new Help;
    for(;;) {
    do {
    hlpobj.showmenu();
    do {
    choice = (char) System.in.read () ;
    } while (choice == '\n' | choice == '\r');
    } while ( !hlpobj.isvalid (choice) );
    if(choice == 'q' ) break;
    System.out.println("\n");
    hlpobj.helpon(choice);
    Thats what the program code. I don't understand especially after the " } while( !hlpobj.isvalid(choice)); " part. And i don't know what is !hlpobj means....
    Please help.....

    you have already posted in "new to Java " Forum
    Message was edited by:
    srinivass

  • Please help this dummy...How this program works??

    Hi, I am new in Java...I just bought a book and start to learn the java from that book. Here is one of the project exercise and seems that it is difficult for me to understand the flow of the program.
    class HelpClassDemo {
    public static void main(String args [])
    throws java.io.IOException () {
    char choice;
    Help hlpobj = new Help;
    for(;;) {
    do {
    hlpobj.showmenu();
    do {
    choice = (char) System.in.read () ;
    } while (choice == '\n' | choice == '\r');
    } while ( !hlpobj.isvalid (choice) );
    if(choice == 'q' ) break;
    System.out.println("\n");
    hlpobj.helpon(choice);
    Thats what the program code. I don't understand especially after the " } while( !hlpobj.isvalid(choice)); " part. And i don't know what is !hlpobj means....
    Please help.....

    is it indicated the opposite of hlpobj object or the
    opposite of isvalid method?the opposite of the result of isvalid method.
    if isvalid method returns true then the opposite of true which false because of the not sign(!)
    */

  • How do super programs work ?

    If anyone can enlighten me on how super programs work in the pet game . a fellow pet player messaged me saying they use these programs & have to pay for them every month . All I know is it gives players an advantage & I dont know anything else . 

    Hi JenniferQ Most of the so called programs are NOT programs they are scripts...that were created from Macrosnot the free add-on extension imacros. Macors can do just about anything in terms of automation. So they the experienced macro user creates what is really called a script. "Coding" but that is justcopy and paste from the run and the only change is the new pet or room you add You open the script and add the pet or cash room you are playing in. You can also add how manyhits you want to hit and how high in value you want to stop at. While it is running you can go havelunch lol...also you can add multiple pets or rooms and or add multiple profiles of yourself. This is not top secret information, many companies and gamers use macros to create automation toolsto work with or in this case play with...so the creator of these scripts have experience and knowlegde whereas we dont, you can easily learn to do it yourself I highly recommend one educates themselves on use of macros esp if you do office work which is whatI use it for as well as comes in handy if you use the web a lot..example I can create a script for all myaccounts all of emails I have to login in and it will do it automatically..in other words Macros can makeeverything repetitious hands-free.........the high end Macros cost around $300-600 USA but the free add- on extension  imacros does a pretty damn good job and you can loop to play pets  Now I did say most so called programs are just fancy Macros there is one that was programed by anexperienced programmer but still Macros does a similar job All it is; is automation with the speed set to FAST and FASTER. Period!!! 

  • When I try to finalize my project a message pops up, "Sharing requires more memory to be available." How do I work this issue out?

    When I try to finalize my project a message pops up, "Sharing requires more memory to be available." How do I work this issue out?

    https://support.apple.com/kb/TS1567
    Ah, it has been mentioned daily esp since iOS 5 / iTunes 10.5 but has always been there as an issue.
    Order of attempts:
    Repair the installers
    Uninstall EVERY Apple component (auto and manual)
    Services: Restart all 3 Apple items (AMS, Bonjour, iPod)
    I* always do the last almost, then launch iTunes, and only then connect iPod.
    IF you see a yellow alert in Devices and Printers or in Device Manager, then I could find NO WAY to fix or repair other than a clean OS. Something messed up the device driver support.
    If/when Windows asks "what to do when it detects iPod"? don't chose any default action, to me, based on hunch and 3 PCs, that seems to mess AMS up for some reason.
    Tried with Windows 7 64-bit Pro and Home Premium, and also Deve Preview 8 (which other than the inability to update iOS to 5.0 seems to run better -- except when it comes to AMS thing! so seems Apple is not on the same page writitng drivers.

  • How can I make my PowerPC/Windows programs work in Mac OS X Lion?

    In a few months I will be buying a MacBook Pro and I have a lot of old games that I would like to be able to play on it. But those games are Windows/PowerPC only and Mac OS X Lion does not support PowerPC. How can I make my old programs work in Mac OS X Lion?

    For porting Windows programs to Mac OS X, you can check out Wineskin.  It can be very simple to very hard to do though... its all a case by case basis.  The older the game is the more likely you are to get it to work easily though.

  • Everytime I try to open a creative cloud product, the program closes. I need to use both illustrator and indesign for school and I was wondering if anyone had any advice on how to actually make the program work?

    If anyone has any advice on how to make creative cloud programs work please let me know!
    Any help is appreciated.

    These questions below may be for a different product... but the KIND of information you need to supply is the same, for the products you use
    More information needed for someone to help... please click below and provide the requested information
    -Premiere Pro Video Editing Information FAQ http://forums.adobe.com/message/4200840

  • How to program a midi foot controller on Mainstage? Does anyone knows how to program the foot controller with exclusive solo channel in order not to dance "tip tap" while from clean guitar I go to crunch or solo? How to do this programming on Mainstage?

    How to program a midi foot controller on Mainstage? Does anyone knows how to program the foot controller with exclusive solo channel in order not to dance "tip tap" while from clean guitar I go to crunch or solo? How to do this programming on Mainstage?
    I basically managed to learn how to invert parameters which allows me to be as default in the clean guitar channel and if I switch the first button on the midi foot controller I switch to crunch, but at this point I tryied so hard to programm the second and third button to switch, only through a button in one step, to a third channel for distorsion or a 4th channel for solo guitar but I couldn't figured out how this work can be done!
    I would appreciate if anyone could help or share this experience with others who are experiencing the same problem.
    Cheers.
    F.

    I cannot seem to get mainstage to recognize my FCB either. I am using IFCB. Anyone figure this out?
    Thanks,
    Eric

  • I would like to know which app/software in MAC gives us the same feature that is provided by System Restore in Windows, and how does that work

    I would like to know which app/software in MAC gives us the same feature that is provided by System Restore in Windows, and how does that work.

    Time Machine is one such program, although it is a recursive backup program which offers limited archive capability, based on the capacity of the backup destination, and it requires you set it up before you start editing your files.   Some programs are also Versions aware, which offers a kind of restore capability by file.  Again needs to be setup before you start editing.
    Just a for-your-info:
    Mac is not an acronym, it is a nickname for Macintosh.

  • JDBC Adapter:- How does it work??

    Dear Friends,
    I would like to know the nuts and bolts of JDBC adapter.
    1.)How does it work internally?Internally what does sap use?
    2.)In my scenario i just need to access a sap table so Can i write my Java JDBC program to access it.?
    3.)Is there any other way to sent data from Idocs to map to a external database with out using XI.?
    thx,
    jeevan

    Hi Jeevan,
    As far as the JDBC adapter goes, internally it uses, obviously JDBC (Java DataBase Connectivity). Thus all the calls from this adapter are internally SQL Queries (Either Select, Insert, Update, Delete, Execute Stored Procedure) that are sent using Java JDBC API.
    In Sender Configuration, it needs a Select and an Update query to be configured into it. It polls the External Database at specific intervals (Polling Interval in the Channel Configuration),i.e., it connects to the Database via a JDBC Connection and runs the select query. The data from the query is sent to XI as an XML Document. The update query is used to update the DB such that the same data is not picked again in the next poll. This is generally done through a status field. The select query's Where clause should pick records with one status and the update should change all those statuses so that the select does not pick them again. Click [Here|http://help.sap.com/saphelp_nw70/helpdata/EN/22/b4d13b633f7748b4d34f3191529946/frameset.htm|SAP Help on JDBC Sender Adapter] for more details, including the format of the XML file sent.
    In receiver configuration, the channels creates SQL statements from the XML Document it receives. This can be either Select, Insert, Update, Delete or Stored Procedure Call Statements. This requires you to give the receiver channel an XML Document in a pre-defined Schema. Click [Here|http://help.sap.com/saphelp_nw70/helpdata/EN/22/b4d13b633f7748b4d34f3191529946/frameset.htm|SAP Help on JDBC Receiver Adapter] for more details including correct XML Schemas. Note that the kind of SQL Statement generated (Select, Update, etc) is dependent on the schema provided.
    Hope this was helpful!!!
    Thanks,
    Guru

  • Is this how to program an algorithm which uses modular arithmatic?

    if ( (x-a)^n is not (x^n-a) (mod x^r-1,n) ) then output COMPOSITE
    from [http://primes.utm.edu/prove/prove4_3.html|http://primes.utm.edu/prove/prove4_3.html]
    a, n, and r are define variables. x is part of a polynomial (I'll use this to handle the polynomial type variables). My question is, how do I program for modular arithmetic? Does this do what the above pseudocode does?
    [ (x-a)^n]-[(x^n-a)]% (x^r-1) != 0 && [ (x-a)^n]-[(x^n-a)]% (n) != 0
    I know that a=b(mod x) means a-b is a multiple of x. Therefore I reason the above statment is correct. I assume the coma in the (mod x^r-1,n) means that (x-a)^n is neither congruent to x^r-1 nor congruent to a.
    I'd just try this out to see if it works, but if it doesn't then I wouldn't be sure if it's this piece of code, or another problem in my program which I causing problems. That's why I ask. Plus if this isn't the way it works then I have no clue how to do this.
    Thanks a lot people

    ok I'm going to emberass myself with this question now. I read the [API for polynomails|http://www.control.lth.se/~kurstr/InternDator/java/regler/se/lth/control/algorithms/Polynomial.html#Polynomial(int,%20double[])] and I can't figure out how to use the polynomials in a program. i.e. I go:
    import se.lth.control.algorithms.BasePolynomial;and when I compile I get the error "package se.lth.control.algorithms.BasePolynomial does not exits". What do I do now? I know this is a lame question, but I basically taught myself that I import whatever is written at the top beneath the bold faced type, when reading the classes API. Anyone want to clue me in on how stuff actually works?
    Edited by: bean-planet on Jul 17, 2008 4:33 PM
    Oh I see now, that's not actually part of Sun's website, it only looks similar. I guess that would explain why the package didn't come with the IDE I'm using. Am I write or just more confused? Can anyone figure out how to download the package so that I can actually use it?
    Edited by: bean-planet on Jul 17, 2008 7:13 PM

  • I want to send 10 bit ADC from PIC via serial communicaton. i send it separetly 8 bit first then the other 2 bit. how to program in labview to capture those two packet then combine it togother

    i want to send 10 bit ADC from PIC mCu via serial communicaton.
     i send it separetly 8 bit first then the other 2 bit (2 bit --> with zero at 6 bit from LSB).
    how to program in labview to capture those two packet and then combine it together
    so i have 10 bit in lab view
    thank you

    Close, but now quite. You need to specify to the VISA Read how many bytes to read, not how many bits. Thus, the input would be 2, not 16. It's also not clear why you're trying to use the "String to Byte Array". The Type Cast will give you a number based on what data type you wired. You're basically telling it how to interpret the string. In this case we're telling it to interpret the string a 16-bit value, so we'll get a 16-bit integer. I know you said you wanted a 10-bit, but you can't have that. You'll get a 16-bit with 6 bits set to zero. Note: I did not completely understand what you said so we may need to change this slightly, but we want to get the communication and reading collection working first.
    Also, since you seem to be setting this in a loop you probably want to monitor this or to collect the data. For that you need a shift register. See attached for a modified version of your attempt. You need to set the datatype to I16 or U16 based on whether the value you get from the PIC is signed or unsigned.
    Message Edited by smercurio_fc on 05-01-2007 02:28 PM
    Attachments:
    Read PIC.vi ‏21 KB
    Read PIC.png ‏7 KB

  • How to program for sync mode batch and immediate

    Hello,
    I have a program that should run in both sync modes (immediate and batch). The first one works well but when switching to batch I've got a lot of exceptions. So my first question is if it is possible to write a program that runs in both modes. My second question is if there is a how-to that explains extensively what is different between those two modes (in calls allowed in one that are harmfull to he other).
    regards
    Joerg
    p.s.
    I've written a small demo program that should show the error but the demo program works fine. But when doing something similar in the main program I've got a lot of NullPointerExceptions. I have no idea where to search or what to do to fix the main program.

    Dear sir...
    i did not try this before,check if each application module has its own mode, if so, then try to make two application modules for your project. one of them in immediate mode and the other in batch mode and use them as you like. But you get a problem that each application module has its own transaction.
    check the link:
    http://www.oracle.com/technology/products/jdev/tips/muench/batchmode/index.html
    hopes this help
    best regards

Maybe you are looking for

  • Why : Data Control entry not expandable/empty - ADF Task flow based on HT.

    Hi All, I've hoping to create an ADF Task flow based on a human task. I have a stand alone ADF application within the ViewController of which I am attempting to create this task flow. The resultant data control entry doesn't seem to be expandable. Qu

  • Clean install of 10.5 disk hangs w/9 minutes to go. Please help. Desperate.

    I'm wiping my hard drive clean and re-installing 10.5, from the disk. I put the disk in, told it to do exactly that, started the run, and it told me it would take about one hour. It ran just fine until it got to "about 9 minutes" -- and it's been the

  • SOAP to Proxy scenario communication error

    Hi Friends,      Now i am developing SOAP to Proxy scenario,  i am testing WSDL file using SOAP UI software and i am getting an error in SOAP UI tool. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Error Report</t

  • Iphone 4s activation at selfsolve.apple

    Hello! I've been browsing internet and apple discussions but failed to find an answer to my specific question. I bought iPhone 4S 64 ggb from Finland (ordered the delivery, so did not talk to the seller myself). The courier promised that the phone is

  • How to make main menu start at loop point when you link back to it?

    I have a main menu with a an intro, after the intro I have put a loop point. But when I link back to the main menu, it plays the whole intro. How do I let the main menu start at the loop point when I target a button back to it?