[讨论]程序赏析1
class point{private int x,y;
public void setpoint(int a,int b)
{
x=a;
y=b;
}
public int getx(){return x;}
public int gety(){return y;}
public String toString()
{return"["+this.getx()+","+this.gety()+"]";}
public static void main(String args[])
{
int i,j;
i=Integer.parseInt(args[0]);
j=Integer.parseInt(args[1]);
point dot=new point();
dot.setpoint(i,j);
System.out.println(dot.toString());
}
}
如此程序居然报错!什么世道啊!请高手指点--
java.lang.ArrayIndexOutOfBoundsException: 0
at point.main(point.java:15)
Exception in thread "main"