Thread: Java Threads
View Single Post
  #13   Spotlight this post!  
Unread 13-03-2011, 15:00
Chris27's Avatar
Chris27 Chris27 is offline
Registered User
AKA: Chris Freeman
FRC #1625 (Winnovation)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Mountain View
Posts: 196
Chris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant future
Re: Java Threads

Quote:
Originally Posted by Aaron V View Post
Alright, thanks everyone - I think I understand.

By default there is only one main thread. If I want to create a thread I can use the Thread class and can pass it a class inherited from "Runnable." Then no pauses in the run function will distract the main code.

To pause the thread I can either use the Timer class or the wait function, but the wait function requires a try...catch function.

Thanks for the quick responses.
fyi, Runnable is an interface not a class.
Reply With Quote