import java.util.Scanner;/**
 *
 * @author Administrator
 */
public class Fan {    int SLOW = 1, MEDIUM = 2, FASE = 3;
    private int speed = SLOW;
    private boolean on = false;
    private double radius = 5;
    private String color = "blue";    public Fan() {
    }    public void setspeed(int s) {
        this.speed = s;
    }    public void setstate(boolean a) {
        this.on = a;
    }    public void setradius(double r) {
        this.radius = r;
    }    public void setcolor(String b) {
        this.color = b;
    }    public int getspeed() {
        return speed;
    }    public boolean getstate() {
        return on;
    }    public double getradius() {
        return radius;
    }    public void toString(boolean on) {
        if (on == true) {
            System.out.println("Fan打开了; " + "Fan的半径: " + radius + "\n" + "速度:" + speed + "\n" + "颜色: " + color + "\n");        } else if (on == false) {
            System.out.println("Fan被关闭了");
        }
    }    public void choose1() {
        Scanner input = new Scanner(System.in);
        System.out.println("1.状态  2.风速  3.半径  4.颜色 5.退出");
        int j = input.nextInt();
        while (j != 5) {
            if (j != 1 && j != 2 && j != 3 && j != 4) {
                System.out.println("输入有误,请重新输入!!!");
            } else if (j == 1) {
                System.out.println("1.关闭风扇  2.打开风扇");
                int k = input.nextInt();
                if (k == 1) {
                    setstate(false);
                } else {
                    setstate(true);
                }
                break;
            } else if (j == 2) {
                System.out.println("1.slow 2.middle 3.fast");
                int k = input.nextInt();
                if (k == 1) {
                    setspeed(1);
                } else if (k == 2) {
                    setspeed(2);
                } else {
                    setspeed(3);
                }
                break;
            } else if (j == 3) {
                System.out.println("输入半径");
                int k = input.nextInt();
                setradius(k);
                break;
            } else if (j == 4) {
                System.out.println("输入颜色");
                String m = input.toString();
                setcolor(m);
                break;
            }
        }
    }    public void choose2() {
        boolean jan = getstate();
        toString(jan);
    }    public static void main(String args[]) {
        Fan application = new Fan();
        int i;
        System.out.println("------------------------------------------------------------");
        System.out.println("1.更改Fan的属性  2.查看Fan的属性 3.退出");
        System.out.println("------------------------------------------------------------");
        Scanner input = new Scanner(System.in);
        i = input.nextInt();
        while (i != 3) {
            if (i != 1 && i != 2) {
                System.out.println("输入有误!");
            } else if (i == 1) {
                application.choose1();
            } else if (i == 2) {
                application.choose2();
            }
            System.out.println("------------------------------------------------------------");
            System.out.println("1.更改Fan的属性  2.查看Fan的属性 3.退出");
            System.out.println("------------------------------------------------------------");
            System.out.println("再次选择");
            i = input.nextInt();
        }
        System.out.println("感谢使用!");
    }
}这里提示有错误。然后我点了继续运行不再提示,可是现在每次运行出错都不在提示直接运行了,现在该怎么做才能让java在出错时发错提示呢???