我遇见过NullPointerException.
目前还没有遇见过IllegalStateException。我想JVM告诉我们是非法操作吧.呵呵

解决方案 »

  1.   

    public class IllegalStateException
    extends RuntimeException
    Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation. 
      

  2.   

    比较容易出现空指针情况我一般都写防错null的时候new一个!
    IllegalStateException到真的不大碰到!
      

  3.   

    个人看法,这是一个运行时候的错误!表示动态的调用一个类并不存在的方法
    比如
    A B 2个类
    再第一次编译的时候
    A 调用 B下的b方法,编译通过了,这是后修改B,去掉b方法,编译通过后
    调用A,就会出现IllegalStateException异常。归根结底,只要理解了JVM的load机制就一了百了!祝你好运!