01 2016 档案
摘要:#!/bin/bashfor i in `ifconfig | grep -o ^[a-z0-9]*`do ifconfig $i|sed -n 2p|awk '{ print $2 }'|tr -d 'addr:'done执行结果按行显示所有网卡的ipifconfig | grep -o ^[a...
阅读全文
摘要:servlet生命周期:Servlet对象是在第一次访问时由容器创建,并完成初始化工作。 对于用户的多次请求,都会调用service为您服务,而不会再创建新的对象。 当应用被写在或者Tomcat关闭,就是执行destroy进行清理工作。 如果希望Tomcat在加载应用时就实例化并完成对Servle...
阅读全文
摘要:执行:cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime是将shanghai时区设置为系统时区执行:date +%s 获取的是系统的utc时间戳执行:date -d '2016-1-14 19:19:28' +%s 是将2016-1-14 19:1...
阅读全文
摘要:1 package com.cn; 2 3 class Test{ 4 public static void main(String [] args){ 5 Q q = new Q(); 6 new Thread(new Producer(q)).star...
阅读全文
摘要:1 package com.cn; 2 3 class Test{ 4 public static void main(String [] args){ 5 TestThread t = new TestThread(); 6 new Thread(t)....
阅读全文
摘要:1 package com.cn; 2 3 class A{ 4 public void fun1(){ 5 System.out.println("A fun1"); 6 } 7 public void fun2(){ 8 fun1();...
阅读全文
摘要:1 package com.cn; 2 3 public class Test { 4 public static void main(String agrs[]){ 5 Person p1 = Person.getInstances(); 6 Perso...
阅读全文
摘要:1 package com.cn; 2 3 public class Test { 4 public static void main(String agrs[]){ 5 int x = 1; 6 switch(x){ 7 case...
阅读全文