上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: 1 import java.util.Date; 2 import java.text.ParseException; 3 import java.text.SimpleDateFormat; 4 public class systemdemo { 5 public static void main(String[] args) { 6 String strDate="2008-10-19 10:11:30.345";//定义日期时间的字符串 7 String pat1="yyyy-MM-dd HH:mm:ss.SSSS";//准备第一个模板,提取日期. 阅读全文
posted @ 2012-03-15 19:28 谈笑风生膜法师 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 1 import java.util.Date; 2 import java.text.DateFormat; 3 public class systemdemo { 4 public static void main(String[] args) { 5 DateFormat df1=null; 6 DateFormat df2=null; 7 df1=DateFormat.getDateInstance(); 8 df2=DateFormat.getDateTimeInstance(); 9 Syst... 阅读全文
posted @ 2012-03-15 19:02 谈笑风生膜法师 阅读(831) 评论(0) 推荐(0) 编辑
摘要: 1 import java.util.Calendar; 2 import java.util.GregorianCalendar; 3 public class systemdemo { 4 public static void main(String[] args) { 5 Calendar calendar=null; 6 calendar =new GregorianCalendar();//子类实例化 7 System.out.println("年: "+calendar.get(Calendar.YEAR)); 8 ... 阅读全文
posted @ 2012-03-15 18:57 谈笑风生膜法师 阅读(7994) 评论(0) 推荐(0) 编辑
摘要: 1 public class systemdemo {2 public static void main(String[] args) {3 System.out.println("系统版本为:"+System.getProperty("os.name")+System.getProperty("os.version")+System.getProperty("os.arch"));4 System.out.println("系统用户为:"+System.getProperty("us 阅读全文
posted @ 2012-03-15 18:42 谈笑风生膜法师 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 1 public class systemdemo { 2 public static void main(String[] args) { 3 long startTime=System.currentTimeMillis(); 4 int sum=0; 5 for(int i=0;i<999999999;i++){ 6 sum+=i; 7 } 8 long endTime=System.currentTimeMillis(); 9 System.out.prin... 阅读全文
posted @ 2012-03-15 18:30 谈笑风生膜法师 阅读(631) 评论(0) 推荐(0) 编辑
摘要: 1 class Info<T,V>{ 2 private T var; 3 private V value; 4 public Info(T var,V value){ 5 this.setVar(var); 6 this.setValue(value); 7 } 8 public T getVar() { 9 return var;10 }11 public void setVar(T var) {12 this.var = var;13 }14 publ... 阅读全文
posted @ 2012-03-14 21:00 谈笑风生膜法师 阅读(2816) 评论(0) 推荐(0) 编辑
摘要: 1 class Info<T>{ 2 private T var; 3 public T getVar(){ 4 return var; 5 } 6 public void setVar(T var){ 7 this.var=var; 8 } 9 public String toString(){10 return this.var.toString();11 }12 }13 public class Generics... 阅读全文
posted @ 2012-03-14 20:44 谈笑风生膜法师 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 1 class Demo{ 2 public <T> T fun(T t){ 3 return t; 4 } 5 } 6 public class GenericsDemo { 7 public static void main(String[] args) { 8 Demo d=new Demo(); 9 String str=d.fun("hsjkdka");10 int i=d.fun(30);11 System.out.println(str);12 System.... 阅读全文
posted @ 2012-03-14 20:21 谈笑风生膜法师 阅读(3668) 评论(0) 推荐(0) 编辑
摘要: 1 interface Info<T>{ 2 public T getVar(); 3 } 4 class Infolmpl implements info<String>{ 5 private String var; 6 public Infolmpl(String Var){ 7 this.setVar(var); 8 } 9 public void setVar(String var){10 this.var=var;11 }12 public String getVar(){... 阅读全文
posted @ 2012-03-14 20:20 谈笑风生膜法师 阅读(7006) 评论(0) 推荐(0) 编辑
摘要: 1 class NotePad<K,V>{ 2 private K key; 3 private V value; 4 public K getKey() { 5 return key; 6 } 7 public void setKey(K key) { 8 this.key = key; 9 }10 public V getValue() {11 return value;12 }13 public void setValue(V value) {14 ... 阅读全文
posted @ 2012-03-14 19:34 谈笑风生膜法师 阅读(7689) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页