Time of Update: 2018-12-04
/** * 直接插入排序 * @author ming * */public class InsertSort {/** * @param args */public static void main(String[] args) {int[] a = {12,3,41,23,6,9,45,23,315,19,0};InsertSort sort = new InsertSort();sort.Sort(a);for (int i = 0; i < a.length; i++)
Time of Update: 2018-12-04
java中的數都是帶符號數,正數和負數;java中有兩種移位,符號位擴充和無符號數移位 1.普通移位操作(<<,>>) (1)正數符號擴充移位,符號擴充不是符號糾正,也就是說,發生下溢出符號改變是不會糾正符號位的。 例如:1<<31 = -2147483648 (2)負數符號擴充移位,進行符號擴充,即負數如何移動還是負數,不可能變為正數,是每移動1位就在頭上補1,而不是一次移動n位再補1。 例如:-1>>10
Time of Update: 2018-12-04
1.JAVA中常用資料類型轉換函式 string->byte Byte static byte parseByte(String s) byte->string Byte static String toString(byte b) char->string Character static String to String (char c) string->Short Short static Short
Time of Update: 2018-12-04
/** * @author YuanZhenhui * @serialData 2006-9-10 * @version 1.0 * */棧介面public interface StackInterface { public boolean isEmpty(); public boolean isFull(); public void push(Object oo) throws OverFlowException; public Object pop()throws
Time of Update: 2018-12-04
Connection ResultSetDatabaseMetaData getTables(null, null, null, new String[]{"TABLE"}); //return ResultSet res.getString("TABLE_NAME") getColumns(null, "%", "t_sarray2", "%"); //return ResultSet
Time of Update: 2018-12-04
package cn.csdn.web.cookie;import java.io.IOException;import java.io.PrintWriter;import java.util.Date;import javax.servlet.ServletException;import javax.servlet.http.Cookie;import javax.servlet.http.HttpServlet;import
Time of Update: 2018-12-04
1、 認識Thread和RunnableJava中實現多線程有兩種途徑:繼承Thread類或者實現Runnable介面。Runnable是介面,建議用介面的方式產生線程,因為介面可以實現多繼承,況且Runnable只有一個run方法,很適合繼承。在使用Thread的時候只需繼承Thread,並且new一個執行個體出來,調用start()方法即可以啟動一個線程。Thread Test = new
Time of Update: 2018-12-04
Introduction to Objects:The Progress of abstraction:.1 All of the programming language privide abstraction.Since all kinds of imperativelanguage is base on the assembly language , and, the assembly language is aabstraction of the underlying
Time of Update: 2018-12-04
首先到poi的官網http://poi.apache.org/上下載最新版的poi包,目前最新版是3.9。操作excel需要用到如下幾個jar包:然後在java工程中匯入上述jar包。代碼如下:import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStream;import
Time of Update: 2018-12-04
矩形類
Time of Update: 2018-12-04
Java數組實現迴圈隊列佟強 http://blog.csdn.net/microtongJava數組實現迴圈隊列,隊尾指標為rear,隊首指標為front,隊尾入隊,隊首出隊,數組空間迴圈利用。 /** * QueueArray.java */package cn.edu.uibe.oop;/** * 數組實現的迴圈隊列 * @author TongQiang */public class QueueArray {Object[] a;
Time of Update: 2018-12-04
在使用Spring的AOP編程時,會用到這幾個lib:asm-2.2.2.jarasm-commons-2.2.2.jarasm-util-2.2.2.jarHibernate使用如下lib:asm.jarasm-attrs.jar其中asm-2.2.2.jar與asm.jar存在類上的衝突!!!使用其中之一或兩者都使用,可能會出現如下錯誤:java.lang.NoClassDefFoundError:
Time of Update: 2018-12-04
1. 有關從控制台如何讀取一個資料或數組並輸出輸入一個數並輸出的2中方法1)BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); //read onenumber Stringstr=br.readLine(); int i=Integer.parseInt(str); System.out.print(i); 2)byte[] b=
Time of Update: 2018-12-04
通俗理解向上轉型:就是子類轉型成父類。class A{}class B extends A{}A b = new B();這個就是向上轉型。 向上轉型可以像下面這條語句這麼簡單:Shape s =new Circle(); 這裡,建立一個Circle對象,並把得到的引用立即賦值給S矇,這樣做看似錯誤(將一種類型賦值給別一種類型);但實際上沒有問題,因為通過繼承,Circle就是一種Shape。因此,編譯器認可這條語句,也就不會產生錯誤資訊。
Time of Update: 2018-12-04
本程式旨在將數組所有排列結果顯示出來,所作的演算法。import java.util.ArrayList;import java.util.Calendar;import java.util.Collections;import java.util.List;public class Range { private static int count = 0;//迴圈的次數 private static int loopTime = 0;//儲存結果的容器 private static
Time of Update: 2018-12-04
/* * ** Network and Service Differentiation Extensions to CloudSim 3.0 ** * * Gokul Poduval & Chen-Khong Tham * Computer Communication Networks (CCN) Lab * Dept of Electrical & Computer Engineering * National University of Singapore * August
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
向jtable添加資料時出現java.lang.IllegalArgumentException: Cannot format given Object as a
Time of Update: 2018-12-04
1.常量--常量表示不能改變的的數值Java中常量的分類:1,整數常量。所有整數2,小數常量。所有小數3,布爾型常量。較為特有,只有兩個數值。true false。4,字元常量。將一個數字字母或者符號用單引號( ' ' )標識。5,字串常量。將一個或者多個字元用雙引號(" ")標識。6,null常量。只有一個數值就是:null.對於整數:java有三種表現形式。十進位:0-9 ,滿10進1.八進位:0-7 ,滿8進1. 用0開頭表示。十六進位:0-9,A-F,滿16進1.