Professional Documents
Culture Documents
Chin - Java 09 Hands On Activity 1 ARG
Chin - Java 09 Hands On Activity 1 ARG
import java.util.*;
public class Chin extends Thread
{
public static void main(String[]args){
Chin thread1 = new Chin();
Chin thread2 = new Chin();
Scanner input = new Scanner (System.in);
String keys,keys1;
System.out.print("Name your first thread: ");
String userName = input.nextLine();
System.out.print("Name your second thread:");
String userName1 = input.nextLine();
thread1.setName("Task A is");
thread2.setName ("Task B is");
thread1.getName();
thread2.getName();
thread1.start();
thread2.start();
try {
Thread.sleep(500);
Thread.sleep(500);
System.out.println(" ");
System.out.println(" after sleep ");