I'm writing a java project that has three different classes. This is what i have have so far. I'm just stuck on how do you call a method function from another class to another class. I have written 2 classes already. I got the "Date" class and "TemperatureRange" class done; now i'm trying to call those 2 classes into "WeatherRecord" class. I'm not sure if i'm explaining this right.
public class WeatherRecord //implements Record
{
private String TemperatureRangetoday;
private String TemperatureRangenormal;
private String TemperatureRangerecord;
public static void main (String[] args){
}
}
This is another class
public class Date
{
public static String date(String date, String month, String year){
String rdate = date + " " +month + " " +year;
return rdate;
}
}
And here's another class
public class TemperatureRange
{
public static String TempRange (String high, String low){
String rTempRange = high +"high" + " "+low+"low";
return rTempRange;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…