各位好 我的问题是
我目前有以下三个类别
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值
呢?