| | |
thread question
Thread Solved |
You can have the class extend the Thread class.
If you don't want to change the code of the old class though you can try to create a new one that extends the old and implements the Runnable interface:
Runnbale
If you don't want to change the code of the old class though you can try to create a new one that extends the old and implements the Runnable interface:
Runnbale
Java Syntax (Toggle Plain Text)
public NewClass extends OldClass implements Runnable { public void run() { ...... } }
Check out my New Bike at my Public Profile at the "About Me" tab
•
•
Join Date: Apr 2008
Posts: 972
Reputation:
Solved Threads: 145
You can use an anonymous inner class. Something like:
Java Syntax (Toggle Plain Text)
new Thread(){ public void run() { // some lines of code } }.start();
![]() |
Similar Threads
- Windows question (Python)
- Best practices question (C++)
- why is a thread "closed"? (DaniWeb Community Feedback)
- simple thread question (C++)
- simple question regarding array (C++)
- thread question (Java)
- quick question (C)
- One more question about Remote desktop (Networking Hardware Configuration)
- qbasic program under Windows XP (Legacy and Other Languages)
Other Threads in the Java Forum
- Previous Thread: Database
- Next Thread: File reading problem
| Thread Tools | Search this Thread |
add android api applet application applications array arrays automation bank binary bluetooth chat class clear client code codesnippet collections component converter database development dice digit ebook eclipse equation error event formatingtextintooltipjava fractal functiontesting game givemetehcodez graphics gui health html hyper ide idea image infinite input int integer invokingapacheantprogrammatically j2me java javame javaprojects jni jpanel julia linux list loop looping main map method methods mobile myregfun mysql netbeans newbie nonstatic openjavafx parameter pearl php problem program programming project recursion repositories scanner scrollbar server set sms sort sorting spamblocker sql sqlserver state storm string superclass swing swt text-file thread threads tree windows






