题目
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
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,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
- 1持之以恒作文开头结尾
- 2张大伯从报社一每份0.4元的价格购进了a分报纸 以每份0.5a的 价格售出了五分之四a份价值 剩余的以每份0.2元价格退回报社 大伯共赚了多少钱?
- 3主量子数、磁量子数、原子轨道的若干问题,能答多少答多少谢谢!
- 4已知a2+2a+b2+1=0,求代数式a(a+4b)-(a+2b)2的值
- 5原计划有600块砖让现有的男孩搬运,后来又来了两个女孩,工作量平均分配,每个男孩比原计划少搬25块,现在有男生几人?
- 6There are _many_ eggs in the basket . 对划线部分提问
- 7满意度计算方法
- 8生物氧化的特点
- 9英语翻译
- 10甲比乙多百分之20,则乙比甲少百分之几,甲是乙的百分之几
热门考点