摘要:
1 class BinaryTree{ 2 class Node{ 3 private Comparable data; 4 private Node left; 5 private Node right; 6 public void addNode(Node newNode){ 7 if(newNode.data.compareTo(this.data)<0){ 8 if(this.left==null){ 9 this.l... 阅读全文
posted @ 2012-03-15 21:04
谈笑风生膜法师
阅读(1643)
评论(0)
推荐(0)
摘要:
1 import java.util.*; 2 public class BigIntDemo { 3 public static void main(String[] args) { 4 int t[]={3,5,6,7,34,23,2}; 5 Arrays.sort(t);//数组排序 6 System.out.print("排序后的数组"); 7 System.out.println(Arrays.toString(t)); 8 int point=Arrays.binarySearch(t, 2... 阅读全文
posted @ 2012-03-15 20:37
谈笑风生膜法师
阅读(640)
评论(0)
推荐(0)
摘要:
1 import java.util.Date; 2 import java.text.SimpleDateFormat; 3 class DateTime{ 4 private SimpleDateFormat sdf=null; 5 public String getDate(){ 6 this.sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); 7 return this.sdf.format(new Date()); 8 } 9 public String getDa... 阅读全文
posted @ 2012-03-15 19:52
谈笑风生膜法师
阅读(7378)
评论(0)
推荐(0)
摘要:
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
谈笑风生膜法师
阅读(361)
评论(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
谈笑风生膜法师
阅读(839)
评论(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
谈笑风生膜法师
阅读(8033)
评论(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
谈笑风生膜法师
阅读(242)
评论(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
谈笑风生膜法师
阅读(637)
评论(0)
推荐(0)

浙公网安备 33010602011771号