public static void main(String[] args) {Runner1 r1 = new Runner1();Thread t = new Thread(r1);t.start();try {Thread.sleep(10000);} catch (InterruptedEx...
分类:
编程语言 时间:
2014-09-25 20:16:17
阅读次数:
168
package src;
public class Main {
public static void main(String args[]){
String chinese = "中文 is english";
int clenth = 0;
try{
clenth = chinese.getBytes("gbk").length;
}catch(Exc...
分类:
编程语言 时间:
2014-09-25 18:35:57
阅读次数:
230
package cn.sql.sqlconn;public class Util { public Util(){ try { Class.forName("com.mysql.jdbc.Driver"); } catch (C...
分类:
数据库 时间:
2014-09-24 22:15:07
阅读次数:
203
执行过程public void method(Action action){ //2.method执行中 try { action(); //3.调用委托 string x = "5"; //如果action执行时出现了error,但是内部有catch机...
分类:
其他好文 时间:
2014-09-24 13:10:46
阅读次数:
155
题意:一个城市n个犯罪嫌疑人,编号1-n,每次输入D x y表示x y属于同一帮派,A x y询问x y是否同一帮派或者不确定。带权、种类并查集裸题,图片质量不好还请见谅。。oet[fx] = (oet[y]-oet[x]+d+2)%2 根据箭头关系就可以得出这个式子了,,加2是防止出现负值#in....
分类:
其他好文 时间:
2014-09-20 01:04:16
阅读次数:
277
有两种方式可以确保数据连接在用完后立即释放1.第一种方式--利用try..catch...finally语句块在finally中关闭任何已经打开的连接try{conn.open();}catch(SqlException ex){ //}finally{conn.Close();}在finally块...
分类:
其他好文 时间:
2014-09-19 22:21:36
阅读次数:
185
题目链接:http://poj.org/problem?id=1703思路:种类并查集。 并设置一个opp数组,opp[i]代表与i相对立的。代码: #include #include using namespace std;int c,d;int t1,t2;int opp[100005];in....
分类:
其他好文 时间:
2014-09-19 15:27:05
阅读次数:
182
最近做一个功能,使用了struts2,input标签里的内容是和后台的实体类内容相对应,提交方法时,无法进入action的方法并且程序也不报错,检查N遍方法都没有发现,最终查找发现,是input标签传递了一个String类型的字符串,但是后台的实体类定义的却是int,导致Action请求不走。仔细分析了一下原因是Struts2已经把这些封装起来,有错误,但是他已经catch住,因此不抛错,导致你无...
分类:
其他好文 时间:
2014-09-18 11:27:13
阅读次数:
173
#include #include #include #include using namespace std;//对于不同的异常可以采取不同的catch块进行捕捉int main(int argc, const char *argv[]){ try { int i; ...
分类:
编程语言 时间:
2014-09-18 00:47:13
阅读次数:
244