When the execution ends?

When run() method returns,the thread has finished its task and is considered dead. There is no way out of this state.Once
a thread is dead,it may not be started again;if you want the thread's task to be performed again,you have to construct
and start a new thread instance. The dad thread continues to exists;it is an object like ay other object and you can still
access its daa and call it methods.You cant make it run again.
In other words:
1. You cant restart a dead thread.
2. You can call the methods of a dead thread.
I tried an examples as below:
1. Implementing a Runnable interface:
package thread;
public class First_type implements Runnable {
public void run(){
     for(int i=0;i<10;i++){
          System.out.println("Hello " +i );
     public static void main(String[] args) {
          First_type type1 =new First_type();
          Thread t =new Thread(type1);
          t.start();
}2. Extending a Thread class
package thread;
public class First_type extends Thread {
public void run(){
     for(int i=0;i<10;i++){
          System.out.println("HELLO "+i );
     public static void main(String[] args) {
          First_type type1 =new First_type();
          type1.start();
}     With reference to italicize paragraph,how can we illustrate that"
When run() method returns,the thread has finished its task and is considered dead.",because when I try re-executing
the above 2 ptograms the run() method runs for the already created thread objects.
I felt once the programs finish there execution,I must recompile the aove source code
by editing the below lines to make it execute again.
First_type type2 =new First_type();Help me to better understand the concept that is above italicize paragraph.

The instance of Thread (or your class which extends it) is dead. But that doesn't affect the class, or prevent you from creating another, viable instance with new.
One reason why Runnable is preferred is that you can re-use the same instance of Runnable, though with a new instance of Thread.

Similar Messages

  • I got problem when trying to contact my iphone 4 using facetime,it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.

    i got problem when trying to call my iphone 4 using facetime with my Macbook Pro 13',it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.Help!! thank you in advance

    i got problem when trying to call my iphone 4 using facetime with my Macbook Pro 13',it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.Help!! thank you in advance

  • How do I close a connection when the session ends?

    I have a website that is using JavaMail to display a user's mail through the browser. I'd like to keep the connection to the mail server open during the whole session that the user is logged in, in order to improve response time. The problem is, I can't detect if a user closes their browser so that I can close the connection to the server.
    Is there a way for me to close the mail server connection when the session ends?
    Thanks.

    Create session listener, Impliment sessionDestryoyed
    method with your connection close statements.I was wondering how to use the listener for a Servlet as well, what would you type in that method to close the connection?.
    public class ServletListener
         implements
              ServletContextListener,
              ServletContextAttributeListener,
              HttpSessionListener,
              HttpSessionAttributeListener
    public void sessionDestroyed(HttpSessionEvent arg0)
              //System.out.println( arg0 );
    }

  • Wait for the execution end of a Thread

    Hi every body,
    How to make a program waiting the execution end of a thread,
    the instruction join did not work fine.
    Computation c = new Computation();
    Thread t = new Thread(c);
    t.start();
    t.join(); // here my thread dead
    System.out.println("done");
    Regards

    Did you try it without t.join?And t did its work fine in that case, but putting the join into the main thread caused t to not do anything?
    I can't say what's happening without more code, but two possibilities pop to mind:
    1) You changed something else, and join has nothing to do with it.
    2) You're syncing on t in a way that interferes with (or gets interference from) join (which also syncs on t).

  • I am being charged for 3 GB that apparently Verizon hadn't caught up on that I had used!! The last night of my cycle I called and checked and I had .5 GB left and right before midnight when the cycle ended it caught up on 3 GB!! I now have to pay for this

    SO CRAPPY!!! SO FED UP WITH VERIZON!! WE ARE GETTING SCREWED OVER!! I am being charged for 3 GB that apparently Verizon hadn't caught up on that I had used!! The last night of my cycle I called and checked and I had .5 GB left and right before midnight when the cycle ended it caught up on 3 GB!! I now have to pay for this data I know I did not use! I never have my data on!! Now it says I used 7 GB last month!!!

    Data usages are always estimated...I don't believe any carrier post data usage in real time.  I've had my data increased due to a large chunk being unaccounted for at the time of my cycle.  Thankfully when I'm billed for it...it has never pushed me over my limit. 

  • Streaming audio file over the network w JMF. How to know when the file end

    Hi
    I am streaming audio file over the network using JMF. I want to be able to know when a file end so I can close the streaming session.
    Can some one please help
    Thanks

    If you put a ControllerListener on the Processor that's associated with generating the RTP stream, it'll generate an "EndOfMedia" event when the end of the file is reached.

  • What happens when the trial ends? (Audition for Mac)

    Might be a silly question - forgive me, I'm a novice.
    I just downloaded Audition for Mac - and was surprised that it's free!
    And when the public beta trial ends - do you lose all your sessions? are you given first dibs for upgrading to the new paid-for software?
    One last one - What can't you do on this version that you can do on Audition 3.0 for Windows?
    Thanks!

    AnnaMChapman wrote:
    And when the public beta trial ends - do you lose all your sessions? are you given first dibs for upgrading to the new paid-for software?
    When the public beta ends, you have to purchase a copy of the release version. You will find that the beta version suddenly won't work any more... and I would imagine that you'll get the same purchase options as everybody else. As for session loss - well you won't lose them if you purchase the software; they'll still open fine.
    One last one - What can't you do on this version that you can do on Audition 3.0 for Windows?
    That's a much more complicated question to answer - simply because we haven't made a definitive list yet, and for non-disclosure reasons I can't say anything more than Adobe has already made public. The one thing that's hacking off a lot of AA3.0 users at present is that it is confirmed that the new version won't write CDs directly, though. Also it's a matter of public knowledge that there will be no MIDI sequencing capability either, but personally I'd have that as a gain, not a loss! For a lot of Mac users though, none of this will be an issue because they never had it in the first place; therefore they can hardly miss it...

  • What are the ports required for the Audio, Video and A/V conferencing when the following end points are enabled for QoS in Lync 2013 server?

    Hi All,
    What are the ports required for the Audio, Video and A/V conferencing when the following clients are enabled for QoS in Lync 2013 server?
    Client Type
    Port range  and Protocol required for Audio
    Port range and Protocol required for
    Video
    Port range and Protocol required for
    A/Vconferencing
    Windows Desktop   Client
    Windows mobile App
    Iphone
    Ipad
    Andriod phone
    Andriod Tablet
    MAC desktop client
    Please advise. Many Thanks.

    Out of the box, 1024-65535 for all of the client ports.  :) 
    https://technet.microsoft.com/en-us/library/gg398833.aspx
    You'll want to tune your client ports a bit
    https://technet.microsoft.com/en-us/library/jj204760.aspx as seen here, and then the client ports would use those ranges which is easier to set QoS markings.  I'm not sure the mobile clients respect that setting.
    Elan's got the best writeup for Windows clients here:
    http://www.shudnow.net/2013/02/16/enabling-qos-for-lync-server-2013-and-various-clients-part-1/
    However, the marking of the packets is the tricky part.  Windows can do it via Group Policy, but for the other clients you'll need to have the network specifically prioritize ports regardless of DSCP markings.  You have to do it based on ports
    as the traffic could be peer to peer.
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications
    This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How do I get the CTI line to stop moving when the movie ends?

    When I'm viewing the movie I'm editing, the current time indicator keeps moving past the last frame which is the closing title. Is there a way to stop the CTI line at the last frame? Or do I just have to press the space bar to do this?

    Tommyvincent
    Take a look at the gray tabs of the Work Area Bar to make sure that they span all the intended Timeline content.
    Then look for leftover slivers or files to the right of the end gray tab of the Work Area Bar.
    Press the End Key to see to try to locate the spot which may be causing the problem.
    Please take a look at those aspects of your issue. The answer should be there.
    If not, we will re-think the matter with more details.
    Thanks.
    ATR

  • How do I pay for another month of data when the month ends?

    Is there a customer service rep I can talk to?  This has been nothing but a runaround so far.  I want to pay this company money so that I can continue to use their service.  Why do they make that so hard?

    If you want to go the prepaid route, the easiest way is to sign into  the Verizon web page using the phone number of your device.  Add a credit card number to your Verizon account.  Using a land line, call 1 800 922 0204 = Customer service.  After you give the phone # of your device and your PIN #, you get the option of adding money to your escrow account.  You can add between $15 and $195. It is a fully automated system. 
    Then, when your device runs out of time or GB, you just try to open any web page with your laptop/tablet using the MiFi or jet-pack through a WiFi connection.    Instead of getting the web page you want, you will get the "pay up" portal with 3 choices.  Pick the plan you want and pick "pay with account".  You still have to disconnect and power down the device.  After restarting the device, all should work OK.
    After about 15 minutes, sign into your web page.  You will see your escrow balance goes down by the amount of your plan and your jet-pack has GB ready to use.  At least, that is how it should work.    
    Have fun,
    Dave

  • JSX causing Indesign CC 2014 to Crash even when the execution is successful

    Hi,
    I have JSX which is executing successfull and returning a string value, but even after that indesign CC 2014 is getting crashed as soon as result is Returned from JSX.
    has any one faced such issue ???
    This issue is not there in Indesign CC 9.2 executing the same JSX.

    Finally after a lot of debugging I found the issue.
    In Indesign CC 2014, the handling for Hidden documents has been changed how it used to be for Indesign CC 9.2.
    Now we can not run command doc.Close() on a hidden document. This is what was causing Indesign to Crash.
    Also, app.documents no more contains the count of hidden documents. Only those documents are maintained for which layout is open.
    Not sure if such major API changes have been mentioned as a part of API changes doc.

  • What size/quality photograph is needed when the desired end result is to print as a 17X22 poster?

    I am new to photoshop and need to understand what size and/or quality (color type?) the original photo has to be in order to be able to eventually print the image as large as 17X22 for posters.

    Keep in mind viewing distances typically increase as images get larger, unless the image is for a special purpose and is expected to be viewed with a magnifier or from a closer distance than typical.  A common rule of thumb is to assume the image will be looked at from no closer than its diagonal measurement.
    This is just a swag, but at 17 x 22 you may want 150 to 250 ppi (pixels per inch) to be able to get a pretty nice, crisp print that stands up to reasonable scrutiny.  Most modern digital cameras will yield an image more than sufficiently detailed for this, and there are upsampling and sharpening techniques that can make even an image somewhat lacking in pixel count look very good at that size.
    Look into Perfect Resize (used to be Genuine Fractals) as one such tool.
    Also, conversion of a raw image in Adobe Camera Raw directly to a pixel count higher than the camera's native photosite count is an option, followed by more aggressive sharpening.  I use this technique myself with very good results.  Generally speaking, if your computer is up to it it's a good idea to work on images at a higher resolution than you'll need for their final use.
    Assuming you're going to use raw image processing, I recommend also converting into a wide gamut color space - e.g., ProPhoto RGB, and using 16 bits/channel to edit your images.  If you don't do your own prints, down convert to the recommended color space and format for whatever print house you choose to use (e.g., 8 bit sRGB JPEG).
    -Noel

  • How do I Initialize a button to be enabled when the program start and if pressed then disable and gray it until a certain action is taken then comeback to the enabled state?

    Hi!!!
    I'm doing a program with the following buttons: Run, Abort, Repeat and Exit. When the program starts from the first time only Run and Exit button will be enabled and not disabled so the user doesn't press the Abort and Repeat button. The user has to select from a menu bar the test he wants to make then if he presses the Run button a pop up window will come up asking for the serial number and his name, and will comeback to the main program with the entered information. The user now has to press the Run button again to start the test, when the test starts the Abort button now will be enable
    d and not disabled, when the test ends the Repeat button will be enabled and disabled. If the user selects new test from the menu bar the whole process will come again. I'm having problems with the menu bar because it has a time-out and when that occurs the program gets crazy. Also I'm not sure about what mechanical action I have to use for the Run. Do I need to count the times the Run button is press so the 2nd time is pressed it will be disabled. Do I need to use a sequential and where I initialize the buttons so the first time they are like I want (Inside or OUtside the while loop that ends with the Exit button) Any help wil be appreciated.

    I'm not sure about the menu bar because i've never used them..i tend to go for listboxes instead.
    As for the buttons, if you want to wire the button to a local variable then the button must be a switch, otherwise a latch is ok. But remember you will probably need to reset the button at the end of a run (ie. wire a constant through the while loop to the local variable for the switch). To initialize the buttons at the start, wire constants to their locals outside the main execution while loop.
    Put the disabling/enabling functions in the parts of the program the button has activated. For example, you say the 2nd time the Run button is pressed you run the 'test', enable the Abort button and want to disable the Run button - put these property nodes into th
    e 'test' sequence/loop.
    Sequences are useful to control when you want buttons to be modified. I use them if i cant sequence the order of execution any other way. But try and avoid using multiple frames as it can get confusing if you start hiding code.
    If you are still having problems, post an example of your program in no higher than LV 6.0.2 and i will try and adapt it for you.
    Kim

  • I tried the Aperture trial and liked it but did not buy it when the trial finished. a few weeks later I purchased Snow lepord and purchased Aperture Via the app store. i have not been able to use it because every time I open i get the spinning wheel of de

    I tried the Aperature trial and liked it, but did not purchase it when the trial ended. A few weeks later, i purchased snow lepord and purchased aperture via the app store. I have had not been able to use it since. Each time i open it , afer a few seconds i get the spinning wheel of death and Aperture is frozen. I have to force quit Aperture to shot down mycomputer. I have re-installed Aperture 3 times with th e same result. I have iphoto on my computer as well is this causing the problem? I want my money back!!! Can anyone help?

    You need to delete the trial & then reinstall from the boxed DVD or the Mac App Store. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user.
    Yvan Koenig has written an AppleScript that removes the files. You can find it on his box.com account in for_iWork'09 > other_iWork'09 items > uninstall iWork '09.zip.

  • Error in decimal places while using the currency ends with 4 e.g. CNY4,USD4

    Dear all,
    I need ye help, the problem that a report having a field KONP-KBETR .......the report moves the decimal 2 places to the right.  And so, 412.3846 becomes 41238.46.  ..occurs only when the currency ends in 4 (CNY4, USD4, EUR4..) 
          Can you please guide.
    Thanks in advance .
    Rgds,
    Pem

    Hi,
    I think you are misinterpretting the things.
    1.CNY4, USD4, EUR4 are Currency keys and they does not end with 4 they are CNY, USD, EUR.
    2.and KBETR is CURR(11,2) so it will always display TWO places of decimals.
    Regards,
    Neha

Maybe you are looking for

  • How to get the SAP software loaded on a vista machine

    Hi, I an in Dallas TX. Looking for help to get SAP ABAP application loaded on my vista machine. Have a 3GB RAM, Core 2 Duo T5750 and 320GB HDD with 250GB free space. Is there any technician or shop I can go to in US to get my laptop loaded with SAP s

  • Got Exchage rate open when run aging

    Dear All, our customer is on SAP8.8. One of the superuser reported, when she run the Aging report, she got exchange rate open (US and EU). The other superuser, he doesn't get the exchange rate screen open when he run the report by the same parameters

  • ERROR WHEN START ESR: Cannot activate endpoint for message-driven bean

    Hi Gurus, We just upgraded our PI 7.1 to SP11, and we have finished it successfully, then we go to the /rep/start/repository.jnlp to start the ESR but some error happens,while the ID,SLD and RWB works well, below is the detailed message: Application

  • VISA Set I/O Buffer Size fails with all but one value on Linux RT

    I was unable to initialize a serial port on a cRIO-9030 using a code that works fine on VxWorks and Windows, when I tracked it down to this somewhat strange behaviour; If you call VISA Set I/O Buffer Size on Linux RT (at least on the 9030 device) you

  • Re: Sum for two cross tabs

    Hi Gurus, I created two cross tab reports from two queries query 1 and query 2 . query 1 is division wise turnover and query 2 is plant wise. I used both cross tabs in single tab only. The requirement is i need to merge, so i removed the header for s