Tnx Capt

...but...it seems i didn't define my problem well enough...here goes.. i'll put a part of my programme here...i made a few classes... one extends the other...
public class GeometricFigure{
private String name;
public GeometricFigure(String ime) {
this.ime = ime;
}
public String getName() {
return this.name;
}
}
public class Line extends GeometricFigure {
public Line(int x0, int y0, int x1, int y1) {//coordinates
super("Line");
this.x0 = x0;
this.y0 = y0;
this.x1 = x1;
this.y1 = y1;
}
...
..
..
public static GeometricFigure fromStringArray(String[] params) throws IllegalArgumentException{
try{
int arg_x0 = Integer.parseInt(params[0]);
int arg_y0 = Integer.parseInt(params[1]);
int arg_x1 = Integer.parseInt(params[2]);
int arg_y1 = Integer.parseInt(params[3]);
return new Line(arg_x0, arg_y0, arg_x1, arg_y1);
}
catch(NumberFormatException e)
{
throw new IllegalArgumentException();
}
}
}
how can i make the bolded part print "Exception" when i call for example
GeometricFigure figure = Line.fromStringArray(subarray); from some other function from somewhere (one of the elements of subarray is a string).
... how to make it work ... help
EDIT: anyone...?