Thread in java | Main Thread in java| Primary Thread| Primary Thread in java | Java code for Thread

Published: 29 September 2020
on channel: Praveen Srivastava
157
21

class Threadex
{
public static void main(String args[])
{
Thread t=Thread.currentThread();
System.out.println("Current running thread is "+t);
t.setName("MainThread");
System.out.println("After changing name of the thread is "+t.getName());
try
{
t.sleep(10000);
}
catch(Exception e)
{
System.out.println("Error caught ! "+e);
}
System.out.println("main() is ending");
}
}


On this page of the site you can watch the video online Thread in java | Main Thread in java| Primary Thread| Primary Thread in java | Java code for Thread with a duration of hours minute second in good quality, which was uploaded by the user Praveen Srivastava 29 September 2020, share the link with friends and acquaintances, this video has already been watched 157 times on youtube and it was liked by 21 viewers. Enjoy your viewing!