Java

Program to Implement Multithreading

By June 4, 2016 November 9th, 2016 19 Comments

/**** Java Program to Implement Multithreading ****/

import java.lang.*;
class aa extends Thread
{
public void run()
{
for(int i=0;i<4;i++)
{
try
{
if(i == 3)
{
sleep(4000);
}
}
catch(Exception x)
{ }
System.out.println(i);
}
System.out.println(” i finished “);
}
}
class bb extends Thread
{
public void run()
{
for(int i=0; i<4; i++)
{
System.out.println(i);
}
System.out.println(” ii finished “);
}
}

class cc extends Thread
{
public void run()
{
for(int i=0; i<4; i++)
{
System.out.println(i);
}
System.out.println(” iii finished “);
}
}
class multi_thread
{
public static void main(String arg[])
{
aa a1 = new aa();
bb b1 = new bb();
cc c1 = new cc();
a1.start();
b1.start();
c1.start();
}
}

Output:





Screenshot (300)

19 Comments

  • An impressive share, I just given this onto a colleague who was doing a little analysis on this. And he in truth bought me breakfast as a result of I found it for him.. smile. So let me reword that: Thnx for the deal with! But yeah Thnkx for spending the time to debate this, I feel strongly about it and love reading more on this topic. If possible, as you develop into experience, would you mind updating your blog with more particulars? It’s highly helpful for me. Big thumb up for this blog submit!

  • Your place is valueble for me. Thanks!?

  • yeezy shoes says:

    I simply had to thank you so much all over again. I do not know the things that I could possibly have done without the creative concepts contributed by you regarding this concern. It seemed to be the horrifying difficulty in my position, however , understanding a new professional fashion you resolved that forced me to jump for contentment. I am happy for this work and in addition hope you are aware of a powerful job you happen to be doing educating many people all through your blog. I am certain you have never got to know all of us.

  • Youre so cool! I dont suppose Ive learn something like this before. So nice to seek out somebody with some original thoughts on this subject. realy thanks for beginning this up. this website is something that’s needed on the web, someone with slightly originality. useful job for bringing something new to the internet!

  • Thank you so much for providing individuals with a very pleasant possiblity to read in detail from this blog. It really is so awesome and packed with a good time for me and my office acquaintances to visit your blog minimum three times a week to study the newest tips you have. Not to mention, I’m just at all times amazed concerning the perfect creative ideas served by you. Certain 1 ideas in this article are in fact the most suitable I have ever had.

  • roshe run says:

    Good post. I be taught something tougher on totally different blogs everyday. It will always be stimulating to learn content material from different writers and practice a little bit something from their store. I抎 favor to use some with the content on my blog whether or not you don抰 mind. Natually I抣l provide you with a link in your web blog. Thanks for sharing.

  • This site can be a walk-by way of for the entire info you wished about this and didn抰 know who to ask. Glimpse right here, and you抣l positively discover it.

  • yeezy shoes says:

    I and also my guys have already been examining the nice hints from your web site and so the sudden came up with a terrible suspicion I never expressed respect to the website owner for those tips. My guys are already for this reason very interested to read through all of them and have now seriously been taking pleasure in these things. We appreciate you indeed being very kind and also for making a choice on these kinds of fine issues millions of individuals are really wanting to learn about. My personal honest regret for not expressing appreciation to you sooner.

  • This is the correct blog for anyone who desires to find out about this topic. You realize a lot its nearly hard to argue with you (not that I really would want匟aHa). You definitely put a new spin on a subject thats been written about for years. Nice stuff, just nice!

  • Can I simply say what a reduction to search out somebody who really knows what theyre speaking about on the internet. You undoubtedly know how one can carry a difficulty to light and make it important. Extra individuals need to read this and understand this side of the story. I cant believe youre not more well-liked because you undoubtedly have the gift.

  • adidas nmd says:

    Can I just say what a reduction to seek out somebody who actually is aware of what theyre speaking about on the internet. You definitely know easy methods to deliver a problem to light and make it important. More folks have to read this and understand this aspect of the story. I cant consider youre no more popular because you undoubtedly have the gift.

  • I actually wanted to jot down a quick note in order to say thanks to you for these pleasant advice you are posting at this website. My particularly long internet lookup has at the end been honored with extremely good ideas to go over with my great friends. I ‘d repeat that we site visitors are extremely lucky to dwell in a decent site with many lovely people with good strategies. I feel quite happy to have used your entire website page and look forward to really more amazing times reading here. Thank you once again for a lot of things.

  • very good post, i certainly love this website, keep on it

  • nike dunks says:

    An fascinating discussion is price comment. I believe that you should write extra on this subject, it won’t be a taboo topic but typically persons are not enough to talk on such topics. To the next. Cheers

  • An attention-grabbing discussion is value comment. I believe that it is best to write more on this matter, it may not be a taboo topic however generally individuals are not sufficient to speak on such topics. To the next. Cheers

  • yeezy shoes says:

    I’m also writing to let you understand of the really good encounter my wife’s girl gained studying your web page. She realized a wide variety of issues, which include what it is like to have an excellent teaching spirit to let other people easily understand specific tricky subject matter. You undoubtedly surpassed my expected results. Many thanks for rendering those essential, trustworthy, explanatory and as well as cool tips on this topic to Jane.

  • nike dunks says:

    There are actually a number of particulars like that to take into consideration. That could be a great point to carry up. I provide the thoughts above as basic inspiration however clearly there are questions just like the one you bring up the place the most important factor can be working in trustworthy good faith. I don?t know if greatest practices have emerged around issues like that, however I’m positive that your job is clearly identified as a fair game. Each boys and girls feel the affect of just a moment抯 pleasure, for the rest of their lives.

  • nike zoom says:

    very nice submit, i definitely love this web site, keep on it

  • Aw, this was a really nice post. In concept I want to put in writing like this moreover ?taking time and precise effort to make an excellent article?but what can I say?I procrastinate alot and in no way appear to get one thing done.

Leave a Reply to yeezy boost 350 Cancel Reply