1.设计4个线程,其中两个线程每次对j增加1,另外两个线程对j每次减少1。写出程序。 1 public class Question1 { 2 3 private int j = 0; 4 /** 5 * @param args 6 */ 7 public static void main(String[] args) { 8 Question1 q = new Question1(); 9 Dec dec = q.new Dec();10 Inc inc = q.new Inc();11 ... Read More
posted @ 2013-07-20 22:21 cq-home Views(503) Comments(0) Diggs(0) Edit
1。判断括号是否成对出现 1 import java.util.Stack; 2 3 public class KuoHao 4 { 5 6 public boolean check(String str) 7 { 8 Stack stack = new Stack(); 9 boolean flag = true; 10 for (int i = 0; i 0){ int first = k+1; System.out.println("查找字符串\""+s+"\"的第"+N+"个左括... Read More
posted @ 2013-07-20 22:16 cq-home Views(801) Comments(3) Diggs(0) Edit
具体来说cookie机制采用的是在客户端保持状态的方案,而session机制采用的是在服务器端保持状态的方案。同时我们也看到,由于才服务器端保持状态的方案在客户端也需要保存一个标识,所以session机制可能需要借助于cookie机制来达到保存标识的目的,但实际上还有其他选择*************************************************************************************二、会话cookie和持久cookie的区别******************************************************* Read More
posted @ 2013-07-20 20:23 cq-home Views(186) Comments(0) Diggs(0) Edit