To begin with I have three classes. One called:
Temperature (superclass)
Weather (subclass superclass)
UseTemperature (subclass that holds main method)
For this program the main method is only supposed to display the temperature in Celsius and wind speed. I do not know what the issue is though..
My issue is that setWindSpeed/getWindSpeed cannot be found within UseTemperature.
//TEMPERATURE:
public class Temperature
{
private double degrees;
public void setDegrees (double degrees)
{
this.degrees = degrees;
}
public double getDegrees ()
{
return degrees;
}
/////////////////////////////////////////////////////////////////////////////////////////
//WEATHER:
public class Weather extends Temperature
{
private double windspeed; // Number + km/h
private void setWindSpeed (double windspeed) //setter
{
this.windspeed = windspeed;
}
public double getWindSpeed () //getter
{
return windspeed;
}
}
/////////////////////////////////////////////////////////////////////////////////////////
//USE TEMPERATURE:
class UseTemperature // can be public but makes no diffrence
{
public static void main (String args[])
{
Temperature temp;
temp = new Temperature ();
temp.setDegrees (40.0);
temp.setWindSpeed (70.0); // NOT FOUND IN TEMPERATURE
System.out.print (temp.getDegrees ());
System.out.print (" degrees ");
System.out.println (temp.getWindSpeed()); // NOT FOUND IN TEMPERATURE
System.out.println (" km/h");
}
}