锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲熟妇无码爱v在线观看,日韩亚洲产在线观看,jjzz亚洲亚洲女人 http://www.tkk7.com/wshsdlau/category/51792.html濡備綍瀛﹀ソjava錛屽叾瀹炲緢綆鍗曪紝鍙鐢ㄥ績浣撲細錛屾參鎱㈢Н绱紒 zh-cn Sun, 05 Jan 2014 15:44:13 GMT Sun, 05 Jan 2014 15:44:13 GMT 60 鏁版嵁緇撴瀯瀛︿範緗戝潃 http://www.tkk7.com/wshsdlau/archive/2014/01/02/408402.html鍝堝笇 鍝堝笇 Thu, 02 Jan 2014 14:50:00 GMT http://www.tkk7.com/wshsdlau/archive/2014/01/02/408402.html http://www.tkk7.com/wshsdlau/comments/408402.html http://www.tkk7.com/wshsdlau/archive/2014/01/02/408402.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/408402.html http://www.tkk7.com/wshsdlau/services/trackbacks/408402.html http://www.luocong.com/dsaanotes/index-Z-H-1.htm ]]> java鏁版嵁緇撴瀯涔嬫帓搴?/title> http://www.tkk7.com/wshsdlau/archive/2014/01/02/408401.html鍝堝笇 鍝堝笇 Thu, 02 Jan 2014 14:32:00 GMT http://www.tkk7.com/wshsdlau/archive/2014/01/02/408401.html http://www.tkk7.com/wshsdlau/comments/408401.html http://www.tkk7.com/wshsdlau/archive/2014/01/02/408401.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/408401.html http://www.tkk7.com/wshsdlau/services/trackbacks/408401.html 闃呰鍏ㄦ枃 ]]> jxl.jar 瀵煎嚭excel http://www.tkk7.com/wshsdlau/archive/2012/08/23/386141.html鍝堝笇 鍝堝笇 Thu, 23 Aug 2012 13:21:00 GMT http://www.tkk7.com/wshsdlau/archive/2012/08/23/386141.html http://www.tkk7.com/wshsdlau/comments/386141.html http://www.tkk7.com/wshsdlau/archive/2012/08/23/386141.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/386141.html http://www.tkk7.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鏄疛excelApi鐨勪竴涓被銆?
// 浠ヤ笅鍙互鐞嗚В涓哄垱寤轟竴涓猠xcel鏂囦歡錛岀劧鍚庡湪excel閲岄潰鍒涘緩涓涓〃
OutputStream os = response.getOutputStream();//鍙栧緱杈撳嚭嫻?
WritableWorkbook workbook = Workbook.createWorkbook(os);
WritableSheet sheet = workbook.createSheet("First Sheet", 0);// 緇勭粐excel鏂囦歡鐨勫唴瀹?
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, "韜喚璇?);
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鏂囦歡
workbook.write();
workbook.close();
os.close();
}
%>
]]> Java娉涘瀷鎿﹂櫎 http://www.tkk7.com/wshsdlau/archive/2011/05/06/379165.html鍝堝笇 鍝堝笇 Fri, 06 May 2011 13:16:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/05/06/379165.html http://www.tkk7.com/wshsdlau/comments/379165.html http://www.tkk7.com/wshsdlau/archive/2011/05/06/379165.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379165.html http://www.tkk7.com/wshsdlau/services/trackbacks/379165.html
java 娉涘瀷鐨勬畫閰風幇瀹炲氨鏄細
鍦ㄦ硾鍨嬩唬鐮佸唴閮紝鏃犳硶鑾峰緱浠諱綍鏈夊叧娉涘瀷鍙傛暟綾誨瀷鐨勪俊鎭?/span>
鍦ㄤ嬌鐢ㄦ硾鍨嬫椂錛屼換浣曞叿浣撶殑綾誨瀷閮借鎿﹂櫎錛屽敮涓鐭ラ亾鐨勬槸浣犲湪浣跨敤涓涓璞°傛瘮濡傦細List<String>鍜孡ist<Integer>鍦ㄨ繍琛屼簨瀹炰笂鏄浉鍚岀殑綾誨瀷銆備粬浠兘琚摝闄ゆ垚浠栦滑鐨?span style="line-height: 21px; color: #ff0000;">鍘熺敓綾誨瀷 錛屽嵆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]
鐢變簬鎿﹂櫎錛宬ind瀹為檯涓婂皢琚瓨鍌ㄤ負浜咰lass錛岄潪String.calss銆傚湪鍒涘緩鏁扮粍鐨勬椂鍊欙紝Array.newInstance()瀹為檯涓婂茍娌℃湁鎷ユ湁kind鎵鍚殑綾誨瀷淇℃伅錛屽洜姝ゅ氨涓嶄細浜х敓鍏蜂綋鐨勭粨鏋溿?/p>
濡傛灉瑕佸垱寤轟竴涓鍣ㄨ屼笉鏄暟緇勶紝鎯呭喌鍗存湁鐐逛笉鍚岋細
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();
}
}
鎿?
闄や嬌寰梒reate()鍐呴儴鐨刵ew
ArrayList<T>涓殑<T>琚摝闄や簡錛屽湪榪愯鏃訛紝榪欎釜綾葷殑鍐呴儴娌℃湁浠諱綍<T>錛屼絾鏄張涓嶈兘鎶?
ArrayList<T>鏀逛負ArrayList錛屽惁鍒欒櫧鐒剁紪璇戝櫒閫氳繃錛屼絾浼氱粰鍑鴻鍛娿?/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]
緙栬瘧鍣ㄦ棤娉曠煡閬撴湁鍏砪reate涓璗鐨勪換浣曚俊鎭紝浣嗘槸浠栦粛鐒跺彲浠ュ湪緙栬瘧鏈熺‘淇濇斁緗埌result涓璞″叿鏈塗綾誨瀷銆傚洜姝ゅ氨鏈変簡涓涓幇璞★細鍗充嬌鎿﹂櫎鍦ㄦ柟娉曟垨綾誨唴閮ㄧЩ闄や簡瀹為檯綾誨瀷鐨勪俊鎭紝緙栬瘧鍣ㄨ繕鏄彲浠ュ湪鏂規硶鎴栫被鐨勪嬌鐢ㄧ殑綾誨瀷鐨勫唴閮ㄤ竴鑷存с?/p>
閭d箞灝辨湁涓涓棶棰橈細鎿﹂櫎鍚庣殑涓嶇煡閬撳張鍒扮煡閬撳叾鍏蜂綋綾誨瀷錛屼粬鏄繖涔堝仛鍒扮殑鍛紵
絳旀鏄細鎿﹂櫎鍦ㄦ柟娉曚綋涓Щ闄や簡綾誨瀷淇℃伅錛屾墍浠ュ湪榪愯鏃剁殑闂灝辨槸杈圭晫 錛?span style="line-height: 21px;">鍗沖璞¤繘鍏ュ拰紱誨紑鏂規硶鐨勫湴鐐癸紝榪欐鏄紪璇戝櫒鍦ㄧ紪璇戞湡鎵ц綾誨瀷媯鏌ュ茍鎻掑叆杞瀷浠g爜鐨勫湴鐐廣?/span>
娉涘瀷涓殑鎵鏈夊姩浣滈兘鍙戠敓鍦ㄨ竟鐣屽錛氬浼犻掕繘鏉ョ殑鍊艱繘琛岄澶栫殑緙栬瘧鏈熸鏌ワ紝騫舵彃鍏?瀵逛紶閫掑嚭鍘葷殑鍊肩殑杞瀷銆?/span>
鐢變簬涓嶇敤榪涜寮哄埗杞崲綾誨瀷浜嗭紝鎵浠ュ叿鏈夎緝楂樼殑瀹夊叏鎬у拰鏄撶敤鎬с備絾娉涘瀷鍏跺疄鍙槸鍦ㄧ紪璇戝櫒涓疄鐜扮殑鑰岃櫄鎷熸満騫朵笉璁よ瘑娉涘瀷綾婚」錛屾墍浠ヨ鍦ㄨ櫄鎷熸満涓皢娉涘瀷綾誨瀷榪涜鎿﹂櫎銆備篃灝辨槸璇達紝鍦ㄧ紪璇戦樁孌典嬌鐢ㄦ硾鍨嬶紝榪愯闃舵鍙栨秷娉涘瀷錛屽嵆鎿﹂櫎銆?/pre>
榪欏鑷翠簡涓涓棶棰橈細鏃犳硶鍒涘緩娉涘瀷鏁扮粍銆?/span>
Java鐨勬硾鍨嬪湪緙栬瘧鏃朵細鎿﹂櫎綾誨瀷淇℃伅銆侸ava涓殑鏁扮粍鏄氳繃鍙嶅皠鍔ㄦ佸緩绔嬬殑銆傛病鏈変簡綾誨瀷淇℃伅鎬庝箞鑳芥瀯閫犲嚭鏁扮粍銆?/span>
]]> java鍊間紶閫掑拰鍦板潃浼犻? http://www.tkk7.com/wshsdlau/archive/2011/05/03/379166.html鍝堝笇 鍝堝笇 Tue, 03 May 2011 08:44:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/05/03/379166.html http://www.tkk7.com/wshsdlau/comments/379166.html http://www.tkk7.com/wshsdlau/archive/2011/05/03/379166.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379166.html http://www.tkk7.com/wshsdlau/services/trackbacks/379166.html public class StringBufferTest
{
public void operater(StringBuffer x,StringBuffer y)
{
//string.append(String)瀛楃涓叉坊鍔犲嚱鏁?
x.append(y);
y=x;
System.out.println("operater杈撳嚭錛?+"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杈撳嚭錛歛="+a + ",b=" +b);
}
java鐨勫紩鐢ㄧ被鍨嬫槸鍦板潃浼犻掞紝鍙槸鍦╫perater涓拰main涓緭鍑虹粨鏋滀負浠涔堜笉涓鏍峰憿錛?br />
鍦╩ain涓?
a => new StringBuffer("A");
b => new StringBuffer("B");
鍦╰est.operater(a, b);榪欏彞錛屼紶鍏ョ殑鏄袱涓紩鐢?
鍦╫perater鏂規硶涓紝b琚噸鏂拌祴鍊間簡錛屽嵆寮曠敤鍦板潃鏀瑰彉浜?
================
琛ュ厖涓涓嬶細java涓換浣曚竴涓璞″彉閲忓彧鏄寚鍚戝垱寤虹殑瀵硅薄鐨勪竴涓紩鐢?
渚嬪 String a = "KKK"; 閭d箞 “KKK”鏄垱寤虹殑String瀵硅薄錛?a 鍒欐槸榪欎釜瀵硅薄鐨勫紩鐢紝鎴栬呰a淇濆瓨瀵硅薄“KKK”鍦ㄥ唴瀛樹腑鐨勫湴鍧
“==”涓?#8220;Equals”鍖哄埆
==鎿嶄綔姣旇緝鐨勬槸涓や釜鍙橀噺鐨勫兼槸鍚︾浉絳夛紝瀵逛簬寮曠敤鍨嬪彉閲忚〃紺虹殑鏄袱涓彉閲忓湪鍫嗕腑瀛樺偍鐨勫湴鍧鏄惁鐩稿悓錛屽嵆鏍堜腑鐨勫唴瀹規槸鍚︾浉鍚屻?
equals鎿嶄綔琛ㄧず鐨勪袱涓彉閲忔槸鍚︽槸瀵瑰悓涓涓璞$殑寮曠敤錛屽嵆鍫嗕腑鐨勫唴瀹規槸鍚︾浉鍚屻?
==姣旇緝鐨勬槸2涓璞$殑鍦板潃錛岃宔quals姣旇緝鐨勬槸2涓璞$殑鍐呭銆?
鏄劇劧錛屽綋equals涓簍rue鏃訛紝==涓嶄竴瀹氫負true錛?
]]> StringBuffer涓嶴tring鐨勫尯鍒?/title> http://www.tkk7.com/wshsdlau/archive/2011/05/03/379167.html鍝堝笇 鍝堝笇 Tue, 03 May 2011 08:02:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/05/03/379167.html http://www.tkk7.com/wshsdlau/comments/379167.html http://www.tkk7.com/wshsdlau/archive/2011/05/03/379167.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379167.html http://www.tkk7.com/wshsdlau/services/trackbacks/379167.html
string鍜宻tringbuffer鍖哄埆
榪欐槸濂藉弸闈㈣瘯鐨勪竴閬撻錛屽叾瀹炴垜鐭ラ亾浣跨敤鐨勫尯鍒紝StringBuffer蹇呴』new鍑烘潵錛孲tringBuffer鐨刟ppend鐨勬晥鐜囨瘮string鐨?=鐨勬晥鐜囬珮錛?br />
鍏跺疄鍙戠幇榪樻湁寰堝ぇ鐨勫尯鍒紝鐪嬩簡鐪嬩互鍓峴cjp鐨勮冮
Test
1 public class Test {
2 public static void stringReplace (String text) {
3 text = text.replace( ' j ' , ' i ' );
4 }
5
6 public static void bufferReplace (StringBuffer text) {
7 text = text.append( " C " );
8 }
9
10 public static void main (String args[]) {
11 String textString = new String ( " java " );
12 StringBuffer textBuffer = new StringBuffer ( " java " );
13
14 stringReplace (textString);
15 bufferReplace (textBuffer);
16
17 System.out.println (textString + textBuffer);
18 }
19 }
絳旀鏄?javajavaC
榪欐槸Java鍙傛暟浼犻?by value)閫犳垚鐨?br />
鑰岄鐩腑絎竷琛宼ext = text.append ("C")錛宎ppend鏂規硶浼氭敼鍙榯ext涓殑鍊?br />
鑰岃繖涓猼ext涓巑ain涓殑textBuffer鏄寚鍚戝悓涓涓璞★紝鎵浠ュ搴旂殑杈撳嚭鏄痡avac銆?br />
string鐨勫兼案榪滀笉浼氭敼鍙橈紒
String a = "a";//鍋囪a鎸囧悜鍦板潃0x0001錛?br />
a = "b";//閲嶆柊璐熷煎悗a鎸囧悜鍦板潃0x0002錛屼絾0x0001鍦板潃涓繚瀛樼殑"a"渚濇棫瀛樺湪錛屼絾宸茬粡涓嶅啀鏄痑鎵鎸囧悜鐨勩?br />
浠庤〃闈笂鐪婼tring綾誨瀷鐨勫璞℃敼鍙樹簡鍊鹼紝浣嗕簨瀹炴槸浠栦笉鑳芥敼鍙樺鹼紝鍙兘鏀瑰彉鎸囧悜鐨勫湴鍧
StringBuffer鍒欎笉鍚岋紝鐩存帴鏀瑰彉鎸囧悜鐨勫湴鍧涓繚鐣欑殑鍊?br />
榪樻湁
public static void main(String[] args) {
StringBuffer s1 = new StringBuffer( " a " );
StringBuffer s2 = new StringBuffer( " a " );
s1.equals(s2); // 涓轟粈涔堟槸false
System.out.println(s1.equals(s2));
String s3 = new String( " a " );
String s4 = new String( " a " );
s3.equals(s4); // 涓轟粈涔堟槸true
System.out.println(s3.equals(s4));
}
StringBuffer綾諱腑娌℃湁閲嶆柊瀹氫箟equals榪欎釜鏂規硶錛屽洜姝よ繖涓柟娉曞氨鏉ヨ嚜Object綾伙紝
鑰孫bject綾諱腑鐨別quals鏂規硶鏄敤鏉ユ瘮杈冨湴鍧鐨勶紝鎵浠ョ瓑浜巉alse.
String綾諱腑閲嶆柊瀹氫箟浜唀quals榪欎釜鏂規硶錛岃屼笖姣旇緝鐨勬槸鍊鹼紝鑰屼笉鏄湴鍧銆傛墍浠ヤ細鏄?br />
true銆?
]]>綆楁硶澶у叏 http://www.tkk7.com/wshsdlau/archive/2011/05/03/379168.html鍝堝笇 鍝堝笇 Tue, 03 May 2011 07:19:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/05/03/379168.html http://www.tkk7.com/wshsdlau/comments/379168.html http://www.tkk7.com/wshsdlau/archive/2011/05/03/379168.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379168.html http://www.tkk7.com/wshsdlau/services/trackbacks/379168.html
杈撳嚭涓夎褰?br />
*
**
***
****
***
**
*
1 public static void main(String[] args) {
2 int i = 0 ;
3 for (i = 1 ; i <= 7 ; i ++ ) {
4 if (i <= 4 )
5 for ( int j = 0 ; j < i; j ++ ) {
6 System.out.print( " * " );
7 }
8 if (i > 4 ){
9 for ( int j = 4 ; j > i - 4 ; j -- ) {
10 System.out.print( " * " );
11 }
12 }
13 System.out.println( "" );
14 }
15 }
16
]]> 宸ㄥ拰涔嬬悊瑙et List map http://www.tkk7.com/wshsdlau/archive/2011/04/29/379173.html鍝堝笇 鍝堝笇 Fri, 29 Apr 2011 06:40:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/04/29/379173.html http://www.tkk7.com/wshsdlau/comments/379173.html http://www.tkk7.com/wshsdlau/archive/2011/04/29/379173.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379173.html http://www.tkk7.com/wshsdlau/services/trackbacks/379173.html
Set鏄棤搴忛泦鍚堬紝閲岃竟鐨勫璞℃病鏈夊厛鍚庨『搴忥紝鑰屼笖涓嶈兘閲嶅錛堥噸澶嶆槸鎸囷細鍚屼竴涓被鐨勫璞★紝騫朵笖hashCode鍜宔quals鏂規硶鐨勮繑鍥炲肩浉鍚岋級
List鏄湁搴忛泦鍚堬紝閲岃竟鐨勫璞℃湁鍏堝悗欏哄簭錛屽茍涓斿彲浠ラ噸澶嶏紙閲嶅鏄寚錛屽綋鍙栧緱鎸囧畾鐨勫璞℃椂錛屽悓涓涓被鐨勫璞″茍涓攅quals鏂規硶鐨勮繑鍥炲肩浉鍚屽嵆涓洪噸澶嶏級
Map涓瓨鏀劇殑閿煎璞$殑寮曠敤錛屼絾鏄敭涓嶈兘閲嶅錛堥敭闆嗗嵆鏃犲簭闆嗗悎Set銆愬叿鏈塖et閲嶅鐨勭壒鎬с戯級
Set List 緇ф壙浜咰ollection鎺ュ彛錛屽彲浠ヤ嬌鐢–ollection瀹炵幇澶氭侊紝鑰孧ap娌℃湁銆?br />
]]> 浜屽弶鏍戠殑浠g爜鍙婄悊瑙?/title> http://www.tkk7.com/wshsdlau/archive/2011/04/29/376865.html鍝堝笇 鍝堝笇 Fri, 29 Apr 2011 04:04:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/04/29/376865.html http://www.tkk7.com/wshsdlau/comments/376865.html http://www.tkk7.com/wshsdlau/archive/2011/04/29/376865.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/376865.html http://www.tkk7.com/wshsdlau/services/trackbacks/376865.html 浜屽弶鏍?/span>
public class BinaryTreeExample {
public static void main(String[] args)
{
new BinaryTreeExample().run();
}
static class Node
{
Node left;
Node right;
int value;
public Node( int value) {
this .value = value;
}
}
public void run() {
Node rootnode = new Node( 25 );
System.out.println( " Building tree with rootvalue " + rootnode.value);
System.out.println( " ================================= " );
insert(rootnode, 11 );
insert(rootnode, 15 );
insert(rootnode, 16 );
insert(rootnode, 23 );
insert(rootnode, 79 );
System.out.println( " Traversing tree in order " );
System.out.println( " ================================= " );
printInOrder(rootnode);
}
public void insert(Node node, int value) {
if (value < node.value) {
if (node.left != null ) {
insert(node.left, value);
} else {
System.out.println( " Inserted " + value +
" to left of node " + node.value);
node.left = new Node(value);
}
} else if (value > node.value) {
if (node.right != null ) {
insert(node.right, value);
} else {
System.out.println( " Inserted " + value + " to right of node " + node.value);
node.right = new Node(value);
}
}
}
public void printInOrder(Node node) {
if (node != null ) {
printInOrder(node.left);
System.out.println( " Traversed " + node.value);
printInOrder(node.right);
}
}
}
]]> 鏋勯犳柟娉? 緇ф壙 鎺掑簭 http://www.tkk7.com/wshsdlau/archive/2011/04/27/379182.html鍝堝笇 鍝堝笇 Wed, 27 Apr 2011 06:48:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/04/27/379182.html http://www.tkk7.com/wshsdlau/comments/379182.html http://www.tkk7.com/wshsdlau/archive/2011/04/27/379182.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379182.html http://www.tkk7.com/wshsdlau/services/trackbacks/379182.html public class TestClass {
public TestClass() {
System.out.println( " wll " );
}
public static void main(String[] args) {
TestClass tc = new TestClass();
}
}
緇ф壙
1 public class TestImpl extends TestClass{
2 public TestImpl() {
3 System.out.println( " hehe " );
4 }
5
6
7 public static void main(String[] args) {
8 TestClass tc = new TestImpl();
9
10 }
鎺掑簭
public static void main(String[] args) {
System.out.println( " 鍒濆鐨勯殢鏈烘暟鏄細 " );
int i = 0 ;
int j = 0 ;
int [] num = new int [ 10 ];
for (i = 0 ;i < num.length;i ++ ) {
num[i] = ( int ) (Math.random() * 1000 );
System.out.println( " num[ " + i + " ] " + num[i]);
}
System.out.println( " 鎺掑簭鍚庣殑闅忔満鏁版槸錛?/span>" );
for (i = 0 ;i < num.length;i ++ ) {
for (j = 0 ;j < num.length;j ++ ) {
if (num[i] < num[j]) {
int m = num[j];
num[j] = num[i];
num[i] = m;
}
}
}
for (i = 0 ;i < num.length;i ++ ) {
System.out.println( " num[ " + i + " ] " + num[i]);
}
}
]]>Java Math鐨?floor,round鍜宑eil鐨勬葷粨 http://www.tkk7.com/wshsdlau/archive/2011/04/22/379190.html鍝堝笇 鍝堝笇 Fri, 22 Apr 2011 09:44:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/04/22/379190.html http://www.tkk7.com/wshsdlau/comments/379190.html http://www.tkk7.com/wshsdlau/archive/2011/04/22/379190.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379190.html http://www.tkk7.com/wshsdlau/services/trackbacks/379190.html
ceil 鍚戜笂鍙栨暣
round 鍒欐槸4鑸?鍏ョ殑璁$畻錛宺ound鏂規硶錛屽畠琛ㄧず“鍥涜垗浜斿叆”錛岀畻娉曚負Math.floor(x+0.5)錛屽嵆灝嗗師鏉ョ殑鏁板瓧鍔犱笂0.5鍚庡啀鍚戜笅鍙栨暣錛屾墍浠ワ紝Math.round(11.5)鐨勭粨鏋滀負12錛孧ath.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
]]> 瀛楃涓瞫plit http://www.tkk7.com/wshsdlau/archive/2011/04/22/379191.html鍝堝笇 鍝堝笇 Fri, 22 Apr 2011 09:24:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/04/22/379191.html http://www.tkk7.com/wshsdlau/comments/379191.html http://www.tkk7.com/wshsdlau/archive/2011/04/22/379191.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379191.html http://www.tkk7.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]);
}
]]>java鍒嗛〉浠g爜 http://www.tkk7.com/wshsdlau/archive/2011/04/20/379206.html鍝堝笇 鍝堝笇 Wed, 20 Apr 2011 02:45:00 GMT http://www.tkk7.com/wshsdlau/archive/2011/04/20/379206.html http://www.tkk7.com/wshsdlau/comments/379206.html http://www.tkk7.com/wshsdlau/archive/2011/04/20/379206.html#Feedback 0 http://www.tkk7.com/wshsdlau/comments/commentRss/379206.html http://www.tkk7.com/wshsdlau/services/trackbacks/379206.html <%@ page language="java" contentType="text/html; charset=GBK"
&nbs... 闃呰鍏ㄦ枃 ]]>
主站蜘蛛池模板:
亚洲综合小说久久另类区 |
性xxxx视频播放免费 |
中文字幕亚洲综合久久菠萝蜜 |
亚洲av无码成人影院一区 |
大香人蕉免费视频75 |
亚洲日本成本人观看 |
免费无码精品黄AV电影 |
亚洲欧美日韩综合久久久久 |
成人性生活免费视频 |
亚洲色大18成人网站WWW在线播放 |
久久电影网午夜鲁丝片免费 |
亚洲乱码国产乱码精华 |
国产精品久久久久影院免费 |
青娱乐在线免费观看视频 |
亚洲国产小视频精品久久久三级 |
一区二区三区免费视频播放器 |
亚洲无码在线播放 |
日韩在线不卡免费视频一区 |
亚洲精品电影在线 |
成人午夜视频免费 |
天堂亚洲免费视频 |
亚洲国产精品婷婷久久 |
4虎永免费最新永久免费地址 |
亚洲欧美日韩国产成人 |
亚洲精品成人在线 |
免费无遮挡无码永久视频 |
亚洲av成人一区二区三区 |
亚洲AV无码乱码在线观看性色扶 |
在线观看免费视频一区 |
亚洲国产精品专区 |
国产不卡免费视频 |
久久综合九色综合97免费下载 |
亚洲一区二区免费视频 |
亚洲国产天堂久久久久久 |
一级毛片免费毛片一级毛片免费 |
在线观看亚洲AV每日更新无码 |
亚洲国产主播精品极品网红
|
久久影视综合亚洲 |
暖暖日本免费中文字幕 |
亚洲中文字幕久久精品无码VA |
国产亚洲视频在线播放 |