class SimpleThreading
{
public static void main(String... args)
{
Thread t=new Thread();
System.out.println(t.getName());
System.out.println(Thread.currentThread().getName());
t.start();
System.out.println(Thread.currentThread().getName());
}
}
문 t.start()를 작성 후에는 "스레드 0"에 의해 기본이 JVM.But에 의해 주어진 이름이다 다시 홈페이지를 출력으로 현재 스레드를 인쇄한다 . 누구든지 내가 틀린 곳에서 내 의심을 치울 수 있니? 위의 코드의 출력은 다음과 같습니다 스레드 0 홈페이지 홈페이지메인 스레드 및 현재 스레드
't.start을()'A * 새 * 스레드를 시작합니다. 'main()'메쏘드, 즉 "Main"쓰레드를 실행하는 쓰레드에는 영향을주지 않습니다. – Andreas