• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is the answer correct?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
---
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.
 
stable boy
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Kathy Cai
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic