warning: stop() in java.lang.Thread has been deprecated

Hi All,

I'm beginner 4 Java,
I found this msg when I try to compile my code..
How could I solve this ?

Thank You.
LVL 1
hmlauAsked:
Who is Participating?
 
kotanConnect With a Mentor Commented:
deprecated means that method stop() is old. You should use other new method.

In here, you should use interrupt() instead of stop().
0
 
objectsCommented:
Careful there, interrupt() and stop() do very different things.
0
 
objectsCommented:
stop() is deprecated because it is error prone as mentioned in the javadoc.
0
 
hmlauAuthor Commented:
 
Hi objects,

May I know what is the difference between stop() and interrupt() ??

Thanks.
0
All Courses

From novice to tech pro — start learning today.