各位大大,有关抽象类的问题我不大明白,自己编了个有关这个的程序,可是总是报错,有没有人能给我的程序指正一下啊??顺便再给我讲一下抽象类啊!
package Temperature1;
public abstract class Temperature {
public static final int constant=32;
abstract double Convert(double temp);
public static void main (String [] args){
TemperatureHTF temperaturehtf=new TemperatrureHTF();
System.out.println(temperaturehtf.Temper);
}
}
package Temperature1;
class TemperatrureHTF extends Temperature {
public double temp;
public TemperatrureHTF(double temp) {
this.temp = temp;
}
public double Convert() {
return (temp * 9 / 5 + Temperature.constant);
}
}
package Temperature1;
public class Text {
public static void main(String[] args) {
TemperatrureHTF thtf=new TemperatrureHTF(100);
thtf.Convert();
}
}
[此贴子已经被作者于2006-9-5 12:06:20编辑过]