Click here to watch in Youtube :
Click the below Image to Enlarge
![]() |
| Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation) |
![]() |
| Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation) |
![]() |
| Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation) |
![]() |
| Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation) |
public class HelloRunnable implements Runnable
{
public static void main(String args[])
{
HelloRunnable helloRunnable = new HelloRunnable();
Thread thread = new Thread(helloRunnable);
thread.start();
}
@Override
public void run()
{
System.out.println("Hello from a thread!");
}
}
OutputHello from a thread!
HelloThread.javapublic class HelloThread extends Thread
{
public static void main(String args[])
{
HelloThread helloThread = new HelloThread();
helloThread.start();
}
@Override
public void run()
{
System.out.println("Hello from a thread!");
}
}
Click the below link to download the code:OutputHello from a thread!





No comments:
Post a Comment