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
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
其他人氣:452 ℃時間:2020-06-21 08:07:59
優(yōu)質(zhì)解答
public double calculate() { //這個方法必須return一個double的值return true;} System.out.println("result is"+calc.get().Result());//System.out.println("result is"+calc.get.Result());//get后面少了括號....
我來回答
類似推薦
- 這是我的程序,即求變步長積分
- 當x=____時,代數(shù)式2分之1-x與1-3分之x-1的值相等
- 成語,描述事情不是安照自己的意愿發(fā)展的成語
- 形容老鷹的詞
- 一直關(guān)于x的方程為3x+a=5-6x
- 將250ml密度為1.05g/cm3的質(zhì)量分數(shù)為14%的硫酸跟足量的鐵屑充分反應(yīng),求
- 根據(jù)所學知識對對聯(lián)
- 線性代數(shù):如果n階矩陣A中的所有元素都是1,求出A的所有特征值,并求出A的屬于特征值λ=n的特征向量?
- ( )Chinese are looking forward to learning English well before Beijing Olympics.
- Eggs,though rich in nourishments,have ______ of fat.
- a²-5a-36 分解因式,速求~
- 已知an是首項為19,公差為-2,的等差數(shù)列,sn為an的前n項和 1.求通項an及sn 2.設(shè)(
猜你喜歡
- 1Newton proved that it is ______ the moon is pulled out of a straight path and kept in orbit.
- 2i don,t think it will rain tomorrow,----- ------?
- 3甲.乙兩地相距81千米,小林和小明同時從兩地騎車相向而行,小林每小時行10千米,3小時后兩人相遇.`1`1`1
- 4《床頭上的標簽》中李比希為什么懊悔莫及?
- 5英語翻譯
- 6七年級課課大考卷數(shù)學答案
- 7你根本不健康,所以你必須改變你的飲食的英文是什么?
- 8英語翻譯
- 9已知數(shù)列{an}中,an=4^n-14*2^n-20,n∈N*
- 10A、那樣丑的臉,那樣長的牙,那樣安靜的態(tài)度.他們咀嚼的時候,上牙和下牙交錯地磨來磨去,大鼻孔里冒著熱氣,白沫子粘在胡須上.(駱駝)
- 11有關(guān)“美就在你身邊”的名言
- 12如果1998某人的年齡等于他出生的公元年數(shù)的數(shù)字之和,那么1980年他的年齡是?歲?