??xml version="1.0" encoding="utf-8" standalone="yes"?>久久免费高清视频,九色porny丨国产精品,97色伦图片97色伦在线电影http://www.aygfsteel.com/wshsdlau/category/51792.html如何学好javaQ其实很单,只要用心体会Q慢慢积累!zh-cnSun, 05 Jan 2014 15:44:13 GMTSun, 05 Jan 2014 15:44:13 GMT60数据l构学习|址http://www.aygfsteel.com/wshsdlau/archive/2014/01/02/408402.html哈希哈希Thu, 02 Jan 2014 14:50:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2014/01/02/408402.htmlhttp://www.aygfsteel.com/wshsdlau/comments/408402.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2014/01/02/408402.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/408402.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/408402.htmlhttp://www.luocong.com/dsaanotes/index-Z-H-1.htm

哈希 2014-01-02 22:50 发表评论
]]>
java数据l构之排?/title><link>http://www.aygfsteel.com/wshsdlau/archive/2014/01/02/408401.html</link><dc:creator>哈希</dc:creator><author>哈希</author><pubDate>Thu, 02 Jan 2014 14:32:00 GMT</pubDate><guid>http://www.aygfsteel.com/wshsdlau/archive/2014/01/02/408401.html</guid><wfw:comment>http://www.aygfsteel.com/wshsdlau/comments/408401.html</wfw:comment><comments>http://www.aygfsteel.com/wshsdlau/archive/2014/01/02/408401.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wshsdlau/comments/commentRss/408401.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wshsdlau/services/trackbacks/408401.html</trackback:ping><description><![CDATA[     摘要: 冒排序QBubble SortQ是一U简单的排序法。它重复地走访过要排序的数列Q一ơ比较两个元素,如果他们的顺序错误就把他们交换过来。走访数列的工作是重复地q行直到没有再需要交换,也就是说该数列已l排序完成。这个算法的名字由来是因的元素会经׃换慢?#8220;?#8221;到数列的端?  冒排序法的运作如?  比较盔R的元素。如果第一个比W二个大Q就交换他们...  <a href='http://www.aygfsteel.com/wshsdlau/archive/2014/01/02/408401.html'>阅读全文</a><img src ="http://www.aygfsteel.com/wshsdlau/aggbug/408401.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wshsdlau/" target="_blank">哈希</a> 2014-01-02 22:32 <a href="http://www.aygfsteel.com/wshsdlau/archive/2014/01/02/408401.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jxl.jar 导出excelhttp://www.aygfsteel.com/wshsdlau/archive/2012/08/23/386141.html哈希哈希Thu, 23 Aug 2012 13:21:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2012/08/23/386141.htmlhttp://www.aygfsteel.com/wshsdlau/comments/386141.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2012/08/23/386141.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/386141.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/386141.html <%@ page language="java" contentType="text/html; charset=GBK" %><%@ page import="java.util.*" %> <%@ page import="java.io.OutputStream" %> <%@ page import="jxl.Workbook" %> <%@ page import="jxl.write.WritableCellFormat" %> <%@ page import="jxl.write.WritableSheet" %> <%@ page import="jxl.write.WritableWorkbook" %> <%@ page import="jxl.write.WriteException" %> <%@ page import="java.text.SimpleDateFormat" %> <% response.reset(); response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition", "filename=Member.xls");//attachment// WritableWorkbook是JexcelApi的一个类? // 以下可以理解为创Z个excel文gQ然后在excel里面创徏一个表 OutputStream os = response.getOutputStream();//取得输出? WritableWorkbook workbook = Workbook.createWorkbook(os); WritableSheet sheet = workbook.createSheet("First Sheet", 0);// l织excel文g的内? jxl.write.Label label = null; int excelCol = 0; int row = 0; try { label = new jxl.write.Label(excelCol++, row, "帐号"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "姓名"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "w䆾?); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "联系电话"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "生日"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "城市"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "职业"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "已购音箱型号"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "试听与否"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "邮箱"); sheet.addCell(label); label = new jxl.write.Label(excelCol, row, "注册旉"); sheet.addCell(label); //jxl.write.Number number = null; jxl.write.DateTime dateTime; jxl.write.DateFormat customDateFormat = new jxl.write.DateFormat("yyyy-MM-dd");//旉格式 WritableCellFormat dateFormat = new WritableCellFormat(customDateFormat); for(int i=0;i<10;i++){ excelCol = 0; row = i + 1; SimpleDateFormat formatDate = new SimpleDateFormat("yyyy-MM-dd"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "100"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "100"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "100"); sheet.addCell(label); /*字串格式*/ try{ label = new jxl.write.Label(excelCol++, row, formatDate.format("100")); sheet.addCell(label); }catch (Exception e){ //Maybe somebody fogot to input his birthday ,I need do nothing here! } label = new jxl.write.Label(excelCol++, row, "100"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "100"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "100"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "100"); sheet.addCell(label); label = new jxl.write.Label(excelCol++, row, "100"); sheet.addCell(label); /*旉格式*/ //label = new jxl.write.Label(excelCol, row, formatDate.format(rr.getCreateTime())); //sheet.addCell(label); } } catch (Exception e) { e.printStackTrace(); } finally{ // 生成excel文g workbook.write(); workbook.close(); os.close(); } %>

哈希 2012-08-23 21:21 发表评论
]]>
Java泛型擦除http://www.aygfsteel.com/wshsdlau/archive/2011/05/06/379165.html哈希哈希Fri, 06 May 2011 13:16:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2011/05/06/379165.htmlhttp://www.aygfsteel.com/wshsdlau/comments/379165.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2011/05/06/379165.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/379165.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/379165.html  

java 泛型的残L实就是:

在泛型代码内部,无法获得M有关泛型参数cd的信息?/span>

在用泛型时QQ何具体的cd都被擦除Q唯一知道的是你在使用一个对象。比如:List<String>和List<Integer>在运行事实上是相同的cd。他们都被擦除成他们?span style="line-height: 21px; color: #ff0000;">原生cdQ即List?/span>

snippet 1:

package com.cognizant.ch15;

import java.lang.reflect.Array;
import java.util.Arrays;

public class ArrayMaker<T> {
    private Class<T> kind;

    public ArrayMaker(Class<T> kind) {
       this.kind = kind;
 }

 @SuppressWarnings("unckecked")
   T[] create(int size) {
       return (T[]) Array.newInstance(kind, size);
 }

  public static void main(String[] args) {
      ArrayMaker<String> stringMaker = new ArrayMaker<String>(String.class);
      String[] stringArray = stringMaker.create(10);
      System.out.println(Arrays.toString(stringArray));
 }
}
ouput:[null, null, null, null, null, null, null, null, null, null]

׃擦除Qkind实际上将被存储ؓ了ClassQ非String.calss。在创徏数组的时候,Array.newInstance()实际上ƈ没有拥有kind所含的cd信息Q因此就不会产生具体的结果?/p>

如果要创Z个容器而不是数l,情况却有点不同:

snippet 2:

public class ListMaker<T>{

   List<T> create(){

      return new ArrayList<T>();

}

  public static void main(String[] args){

      ListMaker<String> stringMaker=new ListMaker<String>();

      List<String> stringList=stringMaker.create();

}

}

? 除得create()内部的new ArrayList<T>中的<T>被擦除了Q在q行Ӟq个cȝ内部没有M<T>Q但是又不能? ArrayList<T>改ؓArrayListQ否则虽然编译器通过Q但会给告?/p>

snippet 3:

package com.cognizant.ch15;

import java.util.ArrayList;
import java.util.List;

public class FilledListMaker<T> {
   List<T> create(T t, int n) {
   List<T> result = new ArrayList<T>();
    for (int i = 0; i < n; i++) {
       result.add(t);
  }
    return result;
 }

 public static void main(String[] args) {
    FilledListMaker<String> stringMaker = new FilledListMaker<String>();
    List<String> list = stringMaker.create("hello", 6);
    System.out.println(list);
 }
}

output:[hello, hello, hello, hello, hello, hello]

~译器无法知道有关create中T的Q何信息,但是他仍然可以在~译期确保放|到result中对象具有Tcd。因此就有了一个现象:即擦除在方法或cd部移除了实际cd的信息,~译器还是可以在Ҏ或类的用的cd的内部一致性?/p>

那么有一个问题:擦除后的不知道又到知道其具体cdQ他是这么做到的呢?

{案是:擦除在方法体中移除了cd信息Q所以在q行时的问题是边界Q?span style="line-height: 21px;">卛_象进入和dҎ的地点,q正是编译器在编译期执行cd查ƈ插入转型代码的地炏V?/span>

泛型中的所有动作都发生在边界处Q对传递进来的D行额外的~译期检查,q插?对传递出ȝ值的转型?/span>

׃不用q行强制转换cd了,所以具有较高的安全性和易用性。但泛型其实只是在编译器中实现的而虚拟机q不认识泛型c项Q所以要在虚拟机中将泛型cdq行擦除。也是_在编译阶D用泛型,q行阶段取消泛型Q即擦除?/pre>
q导致了一个问题:无法创徏泛型数组?/span>
Java的泛型在~译时会擦除cd信息。Java中的数组是通过反射动态徏立的。没有了cd信息怎么能构造出数组?/span>

   





哈希 2011-05-06 21:16 发表评论
]]>javag递和地址传?http://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379166.html哈希哈希Tue, 03 May 2011 08:44:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379166.htmlhttp://www.aygfsteel.com/wshsdlau/comments/379166.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379166.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/379166.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/379166.htmlpublic class StringBufferTest { public void operater(StringBuffer x,StringBuffer y) { //string.append(String)字符串添加函? x.append(y); y=x; System.out.println("operater输出Q?+"a="+x+",b="+y); } public static void main(String [] args) { StringBuffer a=new StringBuffer("A"); StringBuffer b=new StringBuffer("B"); StringBufferTest test=new StringBufferTest(); test.operater(a, b); System.out.println("main输出Qa="+a + ",b=" +b); } java的引用类型是地址传递,可是在operater中和main中输出结果ؓ什么不一样呢Q?br />

在main? a => new StringBuffer("A"); b => new StringBuffer("B"); 在test.operater(a, b);q句Q传入的是两个引? 在operaterҎ中,b被重新赋gQ即引用地址改变? ================ 补充一下:java中Q何一个对象变量只是指向创建的对象的一个引? 例如 String a = "KKK"; 那么 “KKK”是创建的String对象Q?a 则是q个对象的引用,或者说a保存对象“KKK”在内存中的地址

“==”?#8220;Equals”区别

==操作比较的是两个变量的值是否相{,对于引用型变量表C的是两个变量在堆中存储的地址是否相同Q即栈中的内Ҏ否相同? equals操作表示的两个变量是否是对同一个对象的引用Q即堆中的内Ҏ否相同? ==比较的是2个对象的地址Q而equals比较的是2个对象的内容? 昄Q当equals为trueӞ==不一定ؓtrueQ?


哈希 2011-05-03 16:44 发表评论
]]>
StringBuffer与String的区?/title><link>http://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379167.html</link><dc:creator>哈希</dc:creator><author>哈希</author><pubDate>Tue, 03 May 2011 08:02:00 GMT</pubDate><guid>http://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379167.html</guid><wfw:comment>http://www.aygfsteel.com/wshsdlau/comments/379167.html</wfw:comment><comments>http://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379167.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wshsdlau/comments/commentRss/379167.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wshsdlau/services/trackbacks/379167.html</trackback:ping><description><![CDATA[<p> string和stringbuffer区别<br /> q是好友面试的一道题Q其实我知道使用的区别,StringBuffer必须new出来QStringBuffer的append的效率比string?=的效率高Q?br /> 其实发现q有很大的区别,看了看以前scjp的考题<br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><img id="Code_Closed_Image_160323" onclick="this.style.display='none'; Code_Closed_Text_160323.style.display='none'; Code_Open_Image_160323.style.display='inline'; Code_Open_Text_160323.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" alt="" /><img id="Code_Open_Image_160323" style="display: none" onclick="this.style.display='none'; Code_Open_Text_160323.style.display='none'; Code_Closed_Image_160323.style.display='inline'; Code_Closed_Text_160323.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" alt="" /><span id="Code_Closed_Text_160323" style="border-right: #808080 1px solid; border-top: #808080 1px solid; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">Test</span><span id="Code_Open_Text_160323" style="display: none"><br /> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008080; "> 1</span> <span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> Test {<br /> </span><span style="color: #008080; "> 2</span> <span style="color: #000000; ">   </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> stringReplace (String text) {<br /> </span><span style="color: #008080; "> 3</span> <span style="color: #000000; ">   text </span><span style="color: #000000; ">=</span><span style="color: #000000; "> text.replace(</span><span style="color: #000000; ">'</span><span style="color: #000000; ">j</span><span style="color: #000000; ">'</span><span style="color: #000000; "> , </span><span style="color: #000000; ">'</span><span style="color: #000000; ">i</span><span style="color: #000000; ">'</span><span style="color: #000000; ">);<br /> </span><span style="color: #008080; "> 4</span> <span style="color: #000000; ">   }<br /> </span><span style="color: #008080; "> 5</span> <span style="color: #000000; ">  <br /> </span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">   </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> bufferReplace (StringBuffer text) {<br /> </span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">   text </span><span style="color: #000000; ">=</span><span style="color: #000000; "> text.append(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">C</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br /> </span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">   }<br /> </span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">  <br /> </span><span style="color: #008080; ">10</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> main (String args[]) {<br /> </span><span style="color: #008080; ">11</span> <span style="color: #000000; ">    String textString </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> String (</span><span style="color: #000000; ">"</span><span style="color: #000000; ">java</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br /> </span><span style="color: #008080; ">12</span> <span style="color: #000000; ">    StringBuffer textBuffer </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> StringBuffer (</span><span style="color: #000000; ">"</span><span style="color: #000000; ">java</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br /> </span><span style="color: #008080; ">13</span> <span style="color: #000000; ">   <br /> </span><span style="color: #008080; ">14</span> <span style="color: #000000; ">    stringReplace (textString);<br /> </span><span style="color: #008080; ">15</span> <span style="color: #000000; ">    bufferReplace (textBuffer);<br /> </span><span style="color: #008080; ">16</span> <span style="color: #000000; ">   <br /> </span><span style="color: #008080; ">17</span> <span style="color: #000000; ">    System.out.println (textString </span><span style="color: #000000; ">+</span><span style="color: #000000; "> textBuffer);<br /> </span><span style="color: #008080; ">18</span> <span style="color: #000000; ">    }<br /> </span><span style="color: #008080; ">19</span> <span style="color: #000000; ">    }</span></span></div> <p><br /> {案?javajavaC<br /> q是Java参数传?by value)造成?br /> 而题目中W七行text = text.append ("C")QappendҎ会改变text中的?br /> 而这个text与main中的textBuffer是指向同一个对象,所以对应的输出是javac?br /> string的值永q不会改变!<br /> String a = "a";//假设a指向地址0x0001Q?br /> a = "b";//重新负值后a指向地址0x0002Q但0x0001地址中保存的"a"依旧存在Q但已经不再是a所指向的?br /> 从表面上看Stringcd的对象改变了|但事实是他不能改变|只能改变指向的地址<br /> StringBuffer则不同,直接改变指向的地址中保留的?br /> q有 <br /> </p> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> main(String[] args) {<br />         StringBuffer s1 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> StringBuffer(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">a</span><span style="color: #000000; ">"</span><span style="color: #000000;">);<br />         StringBuffer s2 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> StringBuffer(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">a</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />         s1.equals(s2);</span><span style="color: #008000; ">//</span><span style="color: #008000; ">Z么是false</span><span style="color: #008000; "><br /> </span><span style="color: #000000; ">        System.out.println(s1.equals(s2));<br />         String s3 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> String(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">a</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />         String s4 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> String(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">a</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />         s3.equals(s4);</span><span style="color: #008000; ">//</span><span style="color: #008000; ">Z么是true</span><span style="color: #008000; "><br /> </span><span style="color: #000000; ">        System.out.println(s3.equals(s4));<br />     }<br />     <br /> </span></div> <p><br /> StringBuffercM没有重新定义equalsq个ҎQ因此这个方法就来自Objectc,<br /> 而ObjectcM的equalsҎ是用来比较地址的,所以等于false. </p> <p> StringcM重新定义了equalsq个ҎQ而且比较的是|而不是地址。所以会?br /> true? </p> <img src ="http://www.aygfsteel.com/wshsdlau/aggbug/379167.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wshsdlau/" target="_blank">哈希</a> 2011-05-03 16:02 <a href="http://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379167.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>法大全http://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379168.html哈希哈希Tue, 03 May 2011 07:19:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379168.htmlhttp://www.aygfsteel.com/wshsdlau/comments/379168.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2011/05/03/379168.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/379168.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/379168.html
输出三角?br /> *
**
***
****
***
**
*



哈希 2011-05-03 15:19 发表评论
]]>
巨和之理解set List map http://www.aygfsteel.com/wshsdlau/archive/2011/04/29/379173.html哈希哈希Fri, 29 Apr 2011 06:40:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2011/04/29/379173.htmlhttp://www.aygfsteel.com/wshsdlau/comments/379173.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2011/04/29/379173.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/379173.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/379173.html Set是无序集合,里边的对象没有先后顺序,而且不能重复Q重复是指:同一个类的对象,q且hashCode和equalsҎ的返回值相同)
List是有序集合,里边的对象有先后序Qƈ且可以重复(重复是指Q当取得指定的对象时Q同一个类的对象ƈ且equalsҎ的返回值相同即为重复)
Map中存攄键值对象的引用Q但是键不能重复Q键集即无序集合Set【具有Set重复的特性】)

Set List l承了Collection接口Q可以用Collection实现多态,而Map没有?br />




哈希 2011-04-29 14:40 发表评论
]]>
二叉树的代码及理?/title><link>http://www.aygfsteel.com/wshsdlau/archive/2011/04/29/376865.html</link><dc:creator>哈希</dc:creator><author>哈希</author><pubDate>Fri, 29 Apr 2011 04:04:00 GMT</pubDate><guid>http://www.aygfsteel.com/wshsdlau/archive/2011/04/29/376865.html</guid><wfw:comment>http://www.aygfsteel.com/wshsdlau/comments/376865.html</wfw:comment><comments>http://www.aygfsteel.com/wshsdlau/archive/2011/04/29/376865.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wshsdlau/comments/commentRss/376865.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wshsdlau/services/trackbacks/376865.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><img id="Code_Closed_Image_120521" onclick="this.style.display='none'; Code_Closed_Text_120521.style.display='none'; Code_Open_Image_120521.style.display='inline'; Code_Open_Text_120521.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" alt="" /><img id="Code_Open_Image_120521" style="display: none" onclick="this.style.display='none'; Code_Open_Text_120521.style.display='none'; Code_Closed_Image_120521.style.display='inline'; Code_Closed_Text_120521.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" alt="" /><span id="Code_Closed_Text_120521" style="border-right: #808080 1px solid; border-top: #808080 1px solid; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">二叉?/span><span id="Code_Open_Text_120521" style="display: none"><br /> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> BinaryTreeExample {<br />      </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> main(String[] args)<br /> <br />         {<br />             </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> BinaryTreeExample().run();<br />         }<br /> <br />         </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> Node<br /> <br />        {<br /> <br />             Node left;<br />             Node right;<br />             </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> value;<br /> <br />             </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> Node(</span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> value) {<br />                 </span><span style="color: #0000FF; ">this</span><span style="color: #000000; ">.value </span><span style="color: #000000; ">=</span><span style="color: #000000; "> value;<br />             }<br />         }<br /> <br />         </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> run() {<br />             Node rootnode </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> Node(</span><span style="color: #000000; ">25</span><span style="color: #000000; ">);<br />             System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">Building tree with rootvalue </span><span style="color: #000000; ">"</span><span style="color: #000000; "> </span><span style="color: #000000; ">+</span><span style="color: #000000; "> rootnode.value);<br />             System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">=================================</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />             insert(rootnode, </span><span style="color: #000000; ">11</span><span style="color: #000000; ">);<br />             insert(rootnode, </span><span style="color: #000000; ">15</span><span style="color: #000000; ">);<br />             insert(rootnode, </span><span style="color: #000000; ">16</span><span style="color: #000000; ">);<br />             insert(rootnode, </span><span style="color: #000000; ">23</span><span style="color: #000000; ">);<br />             insert(rootnode, </span><span style="color: #000000; ">79</span><span style="color: #000000; ">);<br />             System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">Traversing tree in order</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />             System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">=================================</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />             printInOrder(rootnode);<br /> <br />         }<br /> <br />         </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> insert(Node node, </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> value) {<br />             </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (value </span><span style="color: #000000; "><</span><span style="color: #000000; "> node.value) {<br />                 </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (node.left </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">) {<br />                     insert(node.left, value);<br />                 } </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> {<br />                     System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">  Inserted </span><span style="color: #000000; ">"</span><span style="color: #000000; "> </span><span style="color: #000000; ">+</span><span style="color: #000000; "> value </span><span style="color: #000000; ">+</span><span style="color: #000000; "><br />                                     </span><span style="color: #000000; ">"</span><span style="color: #000000; "> to left of node </span><span style="color: #000000; ">"</span><span style="color: #000000; "> </span><span style="color: #000000; ">+</span><span style="color: #000000; "> node.value);<br />                     node.left </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> Node(value);<br />                 }<br />             } </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (value </span><span style="color: #000000; ">></span><span style="color: #000000; "> node.value) {<br />                 </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (node.right </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">) {<br />                     insert(node.right, value);<br />                 } </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> {<br />                     System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">  Inserted </span><span style="color: #000000; ">"</span><span style="color: #000000; "> </span><span style="color: #000000; ">+</span><span style="color: #000000; "> value </span><span style="color: #000000; ">+</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">to right of node </span><span style="color: #000000; ">"</span><span style="color: #000000; "> </span><span style="color: #000000; ">+</span><span style="color: #000000; "> node.value);<br />                     node.right </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> Node(value);<br />                 }<br />             }<br />         }<br /> <br />         </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> printInOrder(Node node) {<br />             </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (node </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">) {<br />                 printInOrder(node.left);<br />                 System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">  Traversed </span><span style="color: #000000; ">"</span><span style="color: #000000; "> </span><span style="color: #000000; ">+</span><span style="color: #000000; "> node.value);<br />                 printInOrder(node.right);<br />             }<br />         }<br />    <br /> }<br /> </span></span></div> <br /> <br /> <img src ="http://www.aygfsteel.com/wshsdlau/aggbug/376865.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wshsdlau/" target="_blank">哈希</a> 2011-04-29 12:04 <a href="http://www.aygfsteel.com/wshsdlau/archive/2011/04/29/376865.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>构造方? l承 排序http://www.aygfsteel.com/wshsdlau/archive/2011/04/27/379182.html哈希哈希Wed, 27 Apr 2011 06:48:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2011/04/27/379182.htmlhttp://www.aygfsteel.com/wshsdlau/comments/379182.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2011/04/27/379182.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/379182.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/379182.htmlpublic class TestClass {

    
public TestClass() {
        System.out.println(
"wll");
    }
     
     
    
    
public static void main(String[] args) {
        TestClass tc
=new TestClass();
    }
    
    
    
}

l承



排序






哈希 2011-04-27 14:48 发表评论
]]>
Java Math?floor,round和ceil的ȝhttp://www.aygfsteel.com/wshsdlau/archive/2011/04/22/379190.html哈希哈希Fri, 22 Apr 2011 09:44:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2011/04/22/379190.htmlhttp://www.aygfsteel.com/wshsdlau/comments/379190.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2011/04/22/379190.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/379190.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/379190.html ceil  向上取整
round 则是4?入的计算QroundҎQ它表示“四舍五入”Q算法ؓMath.floor(x+0.5)Q即原来的数字加上0.5后再向下取整Q所以,Math.round(11.5)的结果ؓ12QMath.round(-11.5)的结果ؓ-11?

Math.floor(1.4)=1.0
Math.round(1.4)=1
Math.ceil(1.4)=2.0
Math.floor(1.5)=1.0
Math.round(1.5)=2
Math.ceil(1.5)=2.0
Math.floor(1.6)=1.0
Math.round(1.6)=2
Math.ceil(1.6)=2.0
Math.floor(-1.4)=-2.0
Math.round(-1.4)=-1
Math.ceil(-1.4)=-1.0
Math.floor(-1.5)=-2.0
Math.round(-1.5)=-1
Math.ceil(-1.5)=-1.0
Math.floor(-1.6)=-2.0
Math.round(-1.6)=-2
Math.ceil(-1.6)=-1.0

哈希 2011-04-22 17:44 发表评论
]]>
字符串splithttp://www.aygfsteel.com/wshsdlau/archive/2011/04/22/379191.html哈希哈希Fri, 22 Apr 2011 09:24:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2011/04/22/379191.htmlhttp://www.aygfsteel.com/wshsdlau/comments/379191.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2011/04/22/379191.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/379191.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/379191.html字符串学习:
 String strss
=null;
       String [] str
={"hello","world","janaury","february","thirsday","monday"};    
         
for(int i=0;i<str.length;i++){
        strss
=str[i]+"/";
           }
       
//String strs="nihao a he llo worl d dsa a d f a d";        
        String [] sr=strss.split("/");
       
for(int i=0;i<str.length;i++){
        System.out.println(str[i]);

 String strs="nihao a he llo worl d dsa a d f a d";        
        String [] str
=strs.split("");
        
for(int i=0;i<str.length;i++){
        System.out.println(str[i]);
        }



哈希 2011-04-22 17:24 发表评论
]]>
java分页代码http://www.aygfsteel.com/wshsdlau/archive/2011/04/20/379206.html哈希哈希Wed, 20 Apr 2011 02:45:00 GMThttp://www.aygfsteel.com/wshsdlau/archive/2011/04/20/379206.htmlhttp://www.aygfsteel.com/wshsdlau/comments/379206.htmlhttp://www.aygfsteel.com/wshsdlau/archive/2011/04/20/379206.html#Feedback0http://www.aygfsteel.com/wshsdlau/comments/commentRss/379206.htmlhttp://www.aygfsteel.com/wshsdlau/services/trackbacks/379206.html<%@ page language="java" contentType="text/html; charset=GBK"  &nbs...  阅读全文

哈希 2011-04-20 10:45 发表评论
]]>
վ֩ģ壺 ľ| կ| | | | Ҧ| ײ| ղ| ɽ| ̨| | | ɽ| | Ͻ| | ʤ| | ɽ| Ǭ| | пѷ| ٲ| | | κ| ԭ| | ʯ| ̩| Ѩ| | пǰ| ¤| Ͽ| ˮ| ˰| | | ij| |