is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
The simplest answer is
- ram.soft2003 May 25, 2013Thread1.run();
Thread2.run();
Thread3.run();
The problem with unrealistic questions is they often have an uninformative answer. ;)
The whole point of having threads is to run them concurrently. If you are not doing that at all, don't use threads.
You might say that; you cannot call the run() method, in which case you cannot use ThreadPoolExecutor because it calls the run() method for you. i.e. thats what submit() eventually does.
EDIT: The results are completely deterministic, becaus ethe fact that there is a Thread involved is irrelivent.
static class PrintThread extends Thread {
public PrintThread(String name) {
super(name);
}
@Override
public void run() {
for (int i = 0; i < 100; i++)
System.out.println(getName() + ": " + i);
}
}
public static void main(String args[]) {
Thread thread1 = new PrintThread("A");
Thread thread2 = new PrintThread("B");
Thread thread3 = new PrintThread("C");
thread1.run();
thread2.run();
thread3.run();
}
Prints
A: 0
A: 1
.. deleted ..
C: 98
C: 99