aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Another Question From JQuest Mock Exam... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Another Question From JQuest Mock Exam..." Watch "Another Question From JQuest Mock Exam..." New topic
Author

Another Question From JQuest Mock Exam...

Barbara Dyer-Bennet
Greenhorn

Joined: Sep 14, 2000
Posts: 10
The question reads: What can you write at the comment //A in the following code that writes the word "running" to the standard output?

class RunTest implements Runnable {
���public static void main(String[] args) {
������RunTest rt = new RunTest();
������Thread t = new Thread(rt);
������// A
���}
���public void run() {
������System.out.println("running");
���}
���void go() {
������start(1);
���}
���void start(int i) {
���}
}

The question asks for all valid options:
a. System.out.println("running");
b. t.start();
c. rt.start();
d. rt.start(1);
I get that a is correct, but why so b? The argument list doesn't match.
Thanks,
Barbara
[This message has been edited by Barbara Dyer-Bennet (edited September 17, 2000).]
[This message has been edited by Barbara Dyer-Bennet (edited September 17, 2000).]
[This message has been edited by Barbara Dyer-Bennet (edited September 17, 2000).]
weisheZhao
Greenhorn

Joined: Sep 10, 2000
Posts: 18
refered to
...jdk1.2.2/docs/api/java/lang/Thread.html#start()
public void start()
Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread.
call start() then call run(), so "running" is print out
 
Don't get me started about those stupid light bulbs.
 
subject: Another Question From JQuest Mock Exam...