java中有几种方法可以实现一个线程?用什么关键字修饰同步方法

2025-04-03 20:30:26
推荐回答(1个)
回答(1):

1, 有2种,第一是实现Runnable的接口,第二种是继承Thread类
2,synchronized