Skip to content

Commit

Permalink
Merge pull request #1173 from MacTavish-exe/patch-2
Browse files Browse the repository at this point in the history
Create runnableInterface.java
  • Loading branch information
fineanmol authored Oct 24, 2021
2 parents e9bafc6 + f099f70 commit b8f132e
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//Using runnable interface

class X implements Runnable
{
public void run()
{
for(int i=1;i<=10;i++)
{
System.out.println("\tThreadX" +i);
}
System.out.println("End of ThreadX");
}
}
class RunnableTest
{
public static void main(String args[])
{
X runnable = new X();
Thread threadX = new Thread(runnable);
threadX.start();
System.out.println("End of main Thread");
}
}

0 comments on commit b8f132e

Please sign in to comment.