1. Write a program to display the name of thread while executing the main() method.
Solution
class ShowMyName{
public static void main(String[] args){
String threadName = Thread.currentThread().getName();
System.out.println("The name of current thread is "+threadName);
}
}
after compilation, run the program and see the result as follows:
prompt>java ShowMyName
The name of current thread is main
Solution
class ShowMyName{
public static void main(String[] args){
String threadName = Thread.currentThread().getName();
System.out.println("The name of current thread is "+threadName);
}
}
after compilation, run the program and see the result as follows:
prompt>java ShowMyName
The name of current thread is main
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Java Training in Chennai | Core Java Training in Chennai | Java Training Institutes
Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai
Nice Blog... Thank you for sharing this information..
ReplyDeleteProvident Kenworth
Vaswani Menlo Park
Marina Skies
I really appreciate the way you write...Please check my work as well
ReplyDeleteJaipur Call Girl
Jaipur Call Girl
Jaipur Call Girl
Delhi Call Girl
Guwahati Call Girl
Guwahati Call Girl
Guwahati Call Girl
Guwahati Call Girl
Aerocity Call Girl
Lucknow Call Girl