Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 905
  • Last Modified:

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.
0
hmlau
Asked:
hmlau
  • 2
1 Solution
 
kotanCommented:
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now