aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Is the answer correct? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Is the answer correct?" Watch "Is the answer correct?" New topic
Author

Is the answer correct?

Kathy Cai
Greenhorn

Joined: Jan 13, 2004
Posts: 13
---
Which statement about Threads is NOT true?
A. Threads allow you to perform more than one task in your program at a time
B. The three elements of a thread are the CPU, the code, and the data
C. There are two ways to create a thread: extend the Thread class or implement the Runnable interface
D. Threads are faster to load, more scalable, and easier to manage than processes
---
The correct choice is C. But I do not get it. Can anyone explain? Thank you.
Thomas De Vos
stable boy
Ranch Hand

Joined: Apr 12, 2003
Posts: 425
The thread class implements all the methods from Runnable.
If you want to create a Thread then you can either subclass the Thread class or create a new class that implements the Runnable interface.
Implementing the Runnable interface is the preferred way, it allows you to extends your own class as multiple inheritance is not supported in Java.
PS: I think when posting a question then the policy is to mention where the question came from.
[ January 13, 2004: Message edited by: Thomas De Vos ]

Try your free <a href="http://www.javacertificate.com" target="_blank" rel="nofollow">SCJP 1.4</a> certification centre.<br />Try your free <a href="http://www.j2eecertificate.com" target="_blank" rel="nofollow">SCWCD</a> certification centre.<br />Try your free <a href="http://www.ejbcertificate.com" target="_blank" rel="nofollow">SCBCD</a> certification centre.<br />Try your <a href="http://www.webspherecertificate.com" target="_blank" rel="nofollow">Websphere (Test 285) </a> certification centre.<br />Try your <a href="http://www.j2mecertificate.com" target="_blank" rel="nofollow">SCMAD</a> certification centre. (New)<br /> <br /><a href="http://blogs.javacertificate.com" target="_blank" rel="nofollow">Java/J2EE Certification Blogging</a>
Kathy Cai
Greenhorn

Joined: Jan 13, 2004
Posts: 13
Thanks. The question and answer were from Sun's Learning CD-ROM JAVA Programming Language.
I agree your comments. However, this means the original answer is not correct. Please note that there is "NOT" in the question. If choice "C" is not correct, which choice is correct?
Pedro Moreira
Greenhorn

Joined: Jan 13, 2004
Posts: 1
The stament that is NOT TRUE about Threads is:
B. The three elements of a thread are the CPU, the code, and the data
all others are correct.


In the sharp formulation of the law of causality-- "if we know the present exactly, we can calculate the future"-it is not the conclusion that is wrong but the premise. <br />--Heisenberg, in uncertainty principle paper, 1927--
Harvinder Singh
Ranch Hand

Joined: Feb 14, 2003
Posts: 90
Which statement about Threads is NOT true?
A. Threads allow you to perform more than one task in your program at a time
B. The three elements of a thread are the CPU, the code, and the data
C. There are two ways to create a thread: extend the Thread class or implement the Runnable interface
D. Threads are faster to load, more scalable, and easier to manage than processes
A)Wrong,Threads executes a process concurrently.Such process should not have task that is comman in both the threads.Like reading from the same file
at the same time.
B)These are not the elements of the Threads. Threads is not bound to any specific CPU.
C)Obvious answer.
d)Threads are not easy to manage there are lots of things that is to be considered to successfully do it.


Hard work beats talent<br />when talent doesn't work hard.<p> - Tim Notke
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is the answer correct?