摘要: 2010-05-25 22:56js读写cookie//JS操作cookies方法!//写cookiesfunction setCookie(name,value){var Days = 30;var exp = new Date(); exp.setTime(exp.getTime() + Days*24*60*60*1000);document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();}//读取cookiesfunction getCookie(nam 阅读全文
posted @ 2012-11-19 21:51 qiuhua 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 不利用临时变量,交换两个变量的值Java代码public class ChangeValue{ /** * <不用第三个变量,交换两个变量的值> */ public static void main(String[] args) { //方法一 精简,一行代码搞定 int x = 3, y = 7, t = 123; System.out.printf("x = %d, y = %d\n", x, y); x = y + 0 * (y = x); System.out.printf("x = %d, y = %d\n", x, y); //方 阅读全文
posted @ 2012-11-19 21:49 qiuhua 阅读(171) 评论(0) 推荐(0) 编辑