在Java中,如下代码创建一个新线程并启动线程: Runnable target=new MyRunnable(); Thread myThread=new Thread(target); 问:以下哪个类可以创建target对象,并能编译正确?

欢迎免费使用小程序搜题/刷题/查看解析,提升学历,成考自考报名,论文代写、论文查重请加客服微信skr-web

在Java中,如下代码创建一个新线程并启动线程: Runnable target=new MyRunnable(); Thread myThread=new Thread(target); 问:以下哪个类可以创建target对象,并能编译正确?

A.public class MyRunnable extends Runnable { public void run(){} }
B.public class MyRunnable extends Object { public void run() {} }
C.public class MyRunnable implements Runnable {public void run() {}}
D.public class MyRunnable implements Runnable {void run() {}}
正确答案C
访客
邮箱
网址

通用的占位符缩略图

人工智能机器人,扫码免费帮你完成工作


  • 自动写文案
  • 自动写小说
  • 马上扫码让Ai帮你完成工作
通用的占位符缩略图

人工智能机器人,扫码免费帮你完成工作

  • 自动写论文
  • 自动写软件
  • 我不是人,但是我比人更聪明,我是强大的Ai
Top