各位好 我的問題是
我目前有以下三個類別
class Schedule
{
void add(Appointment S)
{
}
void query(Appointment S)
{
}
void cancel(Appointment S)
{
}
}
class Appointment
{
String activity;
public Appointment(MyDatetime start, MyDatetime end, String act)
{
activity = act;
}
}
class MyDatetime
{
int y, m, d, h, minu;
public MyDatetime(int year, int month, int day, int hour, int min)
{
y = year;
m = month;
d = day;
h = hour;
minu = min;
}
}
而我宣告了
Schedule sch;
sch.add(new Appointment(new MyDatetime(fyear, fmonth, fday, fhour, fmin), new
MyDatetime(eyear, emonth, eday, ehour, emin), act));
請問該如何在public static void main(String args[]){}得到 MyDatetime裡面的 y值
呢?