当前位置: > class CalcThread extends Thread{...
题目
class CalcThread extends Thread{
private double result;
public void run(){
result=calculate();
}
public double getResult(){
return result;
}
public double calculate() {
}
}
class ShowJoin{
public static void main (String [] args){
CalcThread calc=new CalcThread();
calc.start();
try{
calc.join();
System.out.println("result is"+calc.get.Result());
}
catch (InterruptedException e){
System.out.println("no answer :interrupted");
}
}
}
第九行提示错误This method must return a result of type double
第18行提示calc.get cannot be resolved or is not a field

提问时间:2021-03-14

答案
public double calculate() { //这个方法必须return一个double的值return true;} System.out.println("result is"+calc.get().Result());//System.out.println("result is"+calc.get.Result());//get后面少了括号....
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.