Time of Update: 2018-12-04
public class QuickSort {static String aaa = "-";public static void main(String[] args) {int[] ar = {66,3,25,4,11,12,13,14,3,78,30};//int[] ar = { 20, 23, 9 };sort(ar,0,ar.length-1);for (int i = 0; i < ar.length; i++) {System.out.print(ar[i] + ", "
Time of Update: 2018-12-04
public static String gbk2Utf(String gbk) throws UnsupportedEncodingException {char[] c = gbk.toCharArray();byte[] fullByte = new byte[3*c.length];for (int i=0; i<c.length; i++) {String binary = Integer.toBinaryString(c[i]);StringBuffer sb = new
Time of Update: 2018-12-04
JSON-lib這個Java類包用於把bean,map和XML轉換成JSON並能夠把JSON轉回成bean和DynaBean。 :http://json-lib.sourceforge.net/ 還要需要的第3方包: org.apache.commons(3.2以上版本) org.apache.oronet.sf.ezmorph(ezmorph-1.0.4.jar) nu.xomimport net.sf.json.JSONArray;import net.sf.json.JSONObject;
Time of Update: 2018-12-04
Java中可通過java.awt.Robot來類比發送訊息:鍵盤訊息,滑鼠訊息之類的。先來試試Robot robot = new
Time of Update: 2018-12-04
文章目錄 ArrayList類LinkedList類TreeMap 類HashMap 類
Time of Update: 2018-12-04
總結一:Java IO的一般使用原則:一、按資料來源(去向)分類:1、是檔案: FileInputStream, FileOutputStream, FileReader, FileWriter2、是byte[]:ByteArrayInputStream, ByteArrayOutputStream3、是Char[]: CharArrayReader, CharArrayWriter4、是String: StringBufferInputStream, StringReader,
Time of Update: 2018-12-04
用關鍵字new產生對象:這是最常用的一種方式,例如 new String("hello")用new產生對象的特點是,這個對象的類必須在編譯時間就在classpath中,如果沒有特別的理由和要求,這是我們產生一個對象的第一選擇;Class.forName(String className)。例如Class c =
Time of Update: 2018-12-04
異常:java.lang.IllegalStateException: getOutputStream() has already been called for this response 解決:在使用完輸出資料流以後調用以下兩行代碼即可: out.clear(); out = pageContext.pushBody(); 即:ImageIO.write(image, "JPEG", response.getOutputStream());out.clear();out =
Time of Update: 2018-12-04
今天在做遊戲的聯賽系統,假如有N 人報名參加聯賽,伺服器記錄下報名人數,並對這些人的戰鬥後的結果進行排序,決出前16強或者8強。網上找了下錦標賽排序演算法,內容真少。總結下:1:建樹:這裡說的建樹是建立一顆完全二叉樹。當參加排序的數組不足2的N次冪,將其補足。直到滿足建立一個完全二叉樹2:當某結點的比較對手的參選標誌為“不再參選”,該結點自動升入雙親結點,此動作不計入排序碼比較次數。每次比較出來的第一名都標記為不參賽。3:最終結果是返回到原來的數組之中4:堆排序,資料很多,不多說。/** *
Time of Update: 2018-12-04
虛擬機器產生異常的原由與處理產生原因:1。由於不正常的語句背虛擬機器檢測到。拋出異常在語句執行點。可能情況有:違反語義的操作如數組過界;資源越界;串連程式時出錯 2。java代碼執行throws語句 3。非同步異常:ThreadGroup的stop()方法調用與虛擬機器內部發生錯誤。處理異常:封閉try內部代碼轉到靠try最近的catch語句中,在沒有catch語句情況下該線程停止,只有finnaly語句執行;並且當其線程父類 ThreadGroup調用unCatchedException後才終
Time of Update: 2018-12-04
Open Source Workflow Engines Written in Java A list of active open source workflow projects that are written in Java. Here's a list of Open Source Workflow Engines that are written in Java: Enhydra Shark Shark is completely based on standards from
Time of Update: 2018-12-04
/* * Title: CloudSim Toolkit * Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2009-2010, The University of Melbourne,
Time of Update: 2018-12-04
/* * Title: CloudSim Toolkit * Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2009-2010, The University of Melbourne,
Time of Update: 2018-12-04
/* * Title: CloudSim Toolkit * Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2009-2010, The University of Melbourne,
Time of Update: 2018-12-04
public class diliuzhou_1 {/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stub}}class Trangle { double sideA,sideB,sideC,area,length; boolean boo; public Trangle(double a,double b,double c) {
Time of Update: 2018-12-04
一、類載入器類載入器將.class檔案載入成java虛擬機器的位元組碼Java虛擬機器中可以安裝多個類載入器,系統預設三個主要類載入器,每個類負責載入特定位置的類:BootStrap,ExtClassLoader,AppClassLoader類載入器也是Java類,因為其他是java類的類載入器本身也要被類載入器載入,顯然必須有第一個類載入器不是不是java類,這正是BootStrap。Java虛擬機器中的所有類裝載器採用具有父子關係的樹形結構進行組織,在執行個體化每個類裝載器對象時,需要為其指
Time of Update: 2018-12-04
interface ComputerCompany {//該介面有2個功能:String computerName,void printFunction。public String computerName ();public void printFunction();}interface ComputerWeight {//該介面中有3個功能:double computrWeight,void printName,double printPrice。double computrWeight()
Time of Update: 2018-12-04
原文地址::http://java.e800.com.cn/articles/2009/211/1234334178378_1.html 相關網帖1.Java命令詳解(上)---- http://hubingforever.blog.163.com/blog/static/1710405792011324114234161/ java命令也是SCJP必考內容,很有用處,即使你現在用的是IDE.一、查看用法C:\>java -helpUsage: java [-options] class
Time of Update: 2018-12-04
每次當用new關鍵字建立出一個子類對象時,那麼程式會先執行父類中不帶參數的建構函式,然後再執行子類的建構函式.每次當用new關鍵字建立出一個子類對象時,那麼程式會先執行父類中不帶參數的建構函式,然後再執行子類的建構函式.eg: 我建了三個類,一個是父類(A_constructor) , 第二個是子類(B_constructor) , 第三個是測試用的類(Test_constructor) . 代碼及運行結果如下父類:public class A_constructor { public A_
Time of Update: 2018-12-04
1、首先利用powerdesigner設計資料結構2、通過java程式解析powerdesigner的pdm檔案,將資料結構轉換成為xml設定檔,xml設定檔可以修改增加欄位的校正方法3、利用freemarker編寫java、jsp、設定檔的模板4、產生java代碼,放到臨時檔案中;5、手工修改產生的java檔案,增加特殊商務邏輯代碼; 優點:採用了spring2.0.8