Java -The method sleep(int) is undefined for the type Thread

后端 未结 7 2067
南方客
南方客 2020-12-18 14:46

I\'m getting an error: The method sleep(int) is undefined for the type Thread. I thought the sleep method is in the Thread class in Java.

import java.util.Ra         


        
7条回答
  •  难免孤独
    2020-12-18 15:29

    Fully-qualify Thread since you're trying to use java.lang.Thread, not your own.

提交回复
热议问题