pls explain this prog logic
Answer / nachiyappan
class NewThread4 implements Runnable {
String name; // name of thread
Thread t;
NewThread4(String threadname) {
name = threadname;
t = new Thread(this, name);
System.out.println("New thread: " + t);
t.start(); // Start the thread
}
// This is the entry point for thread.
public void run() {
try {
for (int i = 5; i > 0; i--) {
System.out.println(name + ": " + i);
Thread.sleep(1000);
}
} catch (InterruptedException e) {
System.out.println(name + " interrupted.");
}
System.out.println(name + " exiting.");
}
}
class DemoJoin
{
public static void main(String args[])
{
NewThread4 ob1 = new NewThread4("One");
NewThread4 ob2 = new NewThread4("Two");
NewThread4 ob3 = new NewThread4("Three");
System.out.println("Thread One is alive: " +
ob1.t.isAlive());
System.out.println("Thread Two is alive: " +
ob2.t.isAlive());
System.out.println("Thread Three is alive: " +
ob3.t.isAlive());
// wait for threads to finish
try {
System.out.println("Waiting for threads to
finish.");
ob1.t.join();
ob2.t.join();
ob3.t.join();
} catch (InterruptedException e)
{
System.out.println("Main thread Interrupted");
}
System.out.println("Thread One is alive: " +
ob1.t.isAlive());
System.out.println("Thread Two is alive: " +
ob2.t.isAlive());
System.out.println("Thread Three is alive: " +
ob3.t.isAlive());
System.out.println("Main thread exiting.");
}
}
Is This Answer Correct ? | 0 Yes | 0 No |
1)How to calculate AC Capacity for the Room?
Q1 Design a webpage for a hotel which displays all the information of the hotel such as rooms available, facilities, and packages along with rate list. Apply the different tags available to give it a good style.
what are the difference between grounding,earthing and neutral???????....
what is difference between .dll and .exe files?
How many rounds in dell interview process in dell
2 Answers DELL, IBM, Marvel ERP,
BEL old probationary engineering questions and answers
i am astubent of BE3rd year currently in 6th semester branch information technology till now i have 73% near about in each semester the problem with me is that i have got only 58%in 12th class n 55%in 10th class bcoz of my health now i am ok i have got 2 year loss also bcoz i have not giveen the exam in class 12th rite now i am prep for GATE i am working hard pls tell will i get a good job in future in the good company bcoz my inter percent were not gud pls tell me help me pls
In an entity relationship, y is dominant entity and x is a subordinate entity. Then which of the following is/are correct 1. operationally, if y is deleted, so is x 2. x is existence dependent on y 3. operationally, x is deleted on y 4. operationally, x is deleted, y remains the same
hi i am an CSE engg student and i cleared the PE exam of BEL 2012 both 24/07/012 and 01/08/2012 , so please if someone can help me with PE Interview question or subject or topics which i should cover that help me clear both Interview.PLZ help. my mail id is rjjkumar99@gmail.com
ABOUT US We, the Meritas Team, is a group of committed and hardworking professional techies, trainers and business consultants. We create, improvise and adapt the best practices in training industry to help our students to standout in the job market to get placed fast. Once a student joins with us, we impart the best possible technical real-time training. Along with that we give utmost care to groom his/her communication, leadership, interpersonal and language skills. We have a committed team of professional HR professionals to help our students to find their dream jobs as soon as they finish their courses.
what is the maximum load for MDB, SMDB & DB
series:1,4,2,8,6,24,22,88?