这是截取字符串substring()产生的下标越界异常。原因是可能是字符串为空,或长度不足1
clientabortexception: java.io.ioexception异常
原因是由于服务器正在处理http请求,正在输出内容时,用户关闭了浏览器,造成了clientabortexception异常。它属于i/o异常中比较常见的一种。
clientabortexception caused by: http://www.ahsrst.cn.socketexception: connection reset by peer: socket write error
这种异常已比较常见,通常有以下几种情况:
服务器的并发连接数超过了其承载量,服务器会将其中一些连接down掉;客户关掉了浏览器,而服务器还在给客户端发送数据
java.lang.nullpointerexception空指针异常
出现该异常的原因在于某个引用为null,但却调用了它的某个方法,这时就会出现该异常
classcastexception
类型强制转换异常,例如:object x = new integer(0);system.out.println((string)x);
illegalargumentexception
传递非法参数异常,此异常表明向方法传递了一个不合法或不正确的参数。你看看传值的方法是否参数不正确
arraystoreexception
向数组中存放与声明类型不兼容对象异常,例如:object x[] = new string[3];x[0] = new integer(0);
negativearraysizeexception
创建一个大小为负数的数组错误异常,例如int[] arr = new int[10];int i = arr[-1];
numberformatexception
数字格式异常,例如:把"176//240"这个输入字条转换为一个数字
securityexception
安全异常,例如:android的权限异常,运行java的程序提示missing requited permissions manifest attribute in main jar等
unsupportedoperationexception
不支持的操作异常,例如string teststr = "100,300,400,545,666";list test = arrays.aslist(teststr.split(","));test.remove("100");使用arrays.aslist()方法一定要注意类型的转换。
java中的异常分为两大类:
1.checked exception(非runtime exception)
2.unchecked exception(runtime exception)
运行时异常
runtimeexception类是exception类的子类,它叫做运行时异常,java中的所有运行时异常都会直接或者间接地继承自runtimeexception类。
java中凡是继承自exception,而不继承自runtimeexception类的异常都是非运行时异常。