<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.twig.es/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Launching_and_interrupting_a_thread_example</id>
		<title>Launching and interrupting a thread example - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Launching_and_interrupting_a_thread_example"/>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Launching_and_interrupting_a_thread_example&amp;action=history"/>
		<updated>2026-05-06T18:21:52Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.0</generator>

	<entry>
		<id>https://wiki.twig.es/index.php?title=Launching_and_interrupting_a_thread_example&amp;diff=2057&amp;oldid=prev</id>
		<title>George2: Created page with &quot;&lt;source lang=&quot;java&quot;&gt; public class SleepMessages implements Runnable { static	int a = 0; 			    public void run() { 					try{                                   System.out.print...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Launching_and_interrupting_a_thread_example&amp;diff=2057&amp;oldid=prev"/>
				<updated>2015-05-22T23:36:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt; public class SleepMessages implements Runnable { static	int a = 0; 			    public void run() { 					try{                                   System.out.print...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class SleepMessages implements Runnable {&lt;br /&gt;
static	int a = 0;&lt;br /&gt;
			    public void run() {&lt;br /&gt;
					try{&lt;br /&gt;
                                  System.out.println(&amp;quot;Hello from a thread! a is &amp;quot;+a);&lt;br /&gt;
                                  Thread.sleep(6000);&lt;br /&gt;
                                  System.out.println(&amp;quot;Hello from a thread! a is &amp;quot;+a);&lt;br /&gt;
                                  Thread.sleep(6000);&lt;br /&gt;
                                  System.out.println(&amp;quot;Hello from a thread! a is &amp;quot;+a);&lt;br /&gt;
                        }&lt;br /&gt;
                        catch(Exception e){}&lt;br /&gt;
	                              }&lt;br /&gt;
	                              &lt;br /&gt;
    public static void main(String args[]) throws InterruptedException&lt;br /&gt;
    {&lt;br /&gt;
		//(new Thread(new SleepMessages())).start();&lt;br /&gt;
		SleepMessages sm = new SleepMessages();&lt;br /&gt;
		Thread th = new Thread(sm);&lt;br /&gt;
		th.start();&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
        String importantInfo[] = {&lt;br /&gt;
                                 &amp;quot;Mares eat oats&amp;quot;,&lt;br /&gt;
                                 &amp;quot;Does eat oats&amp;quot;,&lt;br /&gt;
                                 &amp;quot;Little lambs eat ivy&amp;quot;,&lt;br /&gt;
                                 &amp;quot;A kid will eat ivy too&amp;quot;&lt;br /&gt;
                                 };&lt;br /&gt;
&lt;br /&gt;
        for (int i = 0;i &amp;lt; importantInfo.length;i++) {&lt;br /&gt;
                                                      //Pause for 4 seconds&lt;br /&gt;
                                                      Thread.sleep(4000);&lt;br /&gt;
                                                      th.interrupt();&lt;br /&gt;
                                                      //Print a message&lt;br /&gt;
                                                      a = 4;&lt;br /&gt;
                                                      System.out.println(importantInfo[i]);&lt;br /&gt;
                                                      }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>George2</name></author>	</entry>

	</feed>