Hi,
I have java code, in the code there is about 5 lines that I wont to open in new Thread, I don't wont to crate all new class for 5 lines , can I can I implement the Thread inside the method without new class?
stewie griffin 26 Light Poster
Recommended Answers
Jump to PostYou 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:
All 3 Replies
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
stewie griffin 26 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.