java 十万个异常
1 java.net.SocketException: Connection reset by peer: socket write error
异常:Connection reset
解析:( 信息或流 作为发送方,信息发送完成要关闭流 socket.shutdownOutput();)
2 Exception in thread “main” java.lang.IllegalArgumentException
解析:( 不合法的参数异常)案例如下
Date date = new Date();
String str = "21";
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd");
String format = dateFormat.format(str); //IllegalArgumentException
System.out.println(format);
3 ClassCastException 异常
Object[] 无法向下转型 String[] , 因为Object[]跟String[] 不存在父子关系,Object采可以转型String



