throws IOException
来源:互联网 发布:淘宝怎么玩的 编辑:程序博客网 时间:2024/05/22 20:27
public class MyServer
{
// 定义保存所有Socket的ArrayList
public static ArrayList<Socket> socketList
= new ArrayList<Socket>();
public static void main(String[] args)
throws IOException
{
ServerSocket ss = new ServerSocket(30000);
while(true)
{
// 此行代码会阻塞,将一直等待别人的连接
Socket s = ss.accept();
socketList.add(s);
// 每当客户端连接后启动一条ServerThread线程为该客户端服务
new Thread(new ServerThread(s)).start();
}
}
}
throws IOException表示此方法有抛出IOException异常的可能性。
只要此方法的某些代码可能抛出异常,你就必须显式的处理他,要么抓住(try...catch),要么抛出。 0 0
- throws IOException
- throws IOException的意义
- Android OutputStreamWriter's flush method throws IOException
- throws
- IOException
- IOException
- throws && throw
- throws throw
- throws throw
- throw &throws
- JAVA throws
- throw throws
- throw throws
- throw、throws
- clientabortexception:IOException
- java IOException
- IOException 处理
- IOException: Canceled
- win7偶尔会出现远程桌面黑屏解决办法
- C语言高效编程的的四大绝招
- EJB学习一 Ejb介绍与环境搭建(JBoss的安装以及JBoss启动报错IllegalArgumentException的解决)
- python 中文编码问题, ‘ascii’ codec can’t encode characters in position 0-1:
- 运行程序提示access violation at address的解决方法-
- throws IOException
- ICG技术专栏---SSL VPN
- SDL_BlitSurface
- Effective Objective-C 2.0: Item 35: Use Zombies to Help Debug Memory-Management Problems
- DOM对象的dataset属性
- poj 1067&&hdu 1527 取石子游戏
- 关于unity计时问题
- ubunut 管理开机程序
- gprof学习笔记