System.out.println(t.gatday());
=>System.out.println(t.getday());
拼写错误啊!
=>System.out.println(t.getday());
拼写错误啊!
解决方案 »
- swt中table组件不能刷新,求助!!!
- 使用POI将ppt幻灯片导出为图片,但是其中的中文都是乱码,如何解决?
- 谁有JasperReports没有???
- 求助:两个jpanel之间事件响应问题??
- java算法与数据结构
- Java里面有没有像VC++里面的ListCtrl的类。
- 使用JTextArea和JScrollPane怎么实现滚动条自动下滚????
- 急:如何给jpg图片加水印?
- 百分求助, 如何实现Java中的 goto 操作, 如何将Java程序翻译成 Applet?
- 高分求助一个小程序弹出对话框的例子
- linux下的java的日语问题
- applet在IE中正常运行后,就不再刷新了. 为什么? 怎么解决?
public int year;
public int month;
public int day;
public void SetDate(int y,int m,int d){
year=y; month=m; day=d;
if(d>31) System.out.println("day too big error");
}
public void tomorrow(){
day=day+1;
}
public int getday(){
return day;
}
}public class encap{
public static void main(String args[]){
MyDate t=new MyDate();
t.SetDate(2001,1,23);
t.tomorrow();
System.out.println(t.getday());
}
}---------- java_编译 ----------
Normal Termination
输出完成 (耗费 5 秒)。---------- java_运行 ----------
24
Normal Termination
输出完成 (耗费 1 秒)。
class MyDate{
private int year;
private int month;
private int day;
public void setDate(int y,int m,int d){
year=y; month=m; day=d;
if(d>31) System.out.println("day too big error");
}
public void tomorrow(){
day=day+1;
}
public int getday(){
return day;
}
}public class encap{
public static void main(String args[]){
MyDate t=new MyDate();
t.setDate(2001,1,32);
t.tomorrow();
System.out.println(t.gatday());
}
}
System.out.println(t.gatday());
=>System.out.println(t.getday());