Time of Update: 2015-04-21
標籤:最近在看Java,在編譯寫書上一個例子時,由於書上的代碼只有一部分,於是就自己補了一個內部類。結果編譯時間出現:No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instance of type E(e.g. x.new A() where x is an instance of E).
Time of Update: 2015-04-21
標籤:面試題三:尋找二維數組中元素問題 public static void main(String[] args){ int[][] num = {{1,2,8,9},{2,4,9,12},{4,7,10,13},{6,8,11,15}}; search(num,7);
Time of Update: 2015-04-21
標籤:import java.io.*;import java.util.ArrayList;public class Emexe { public static void main(String[] args) throws IOException { EmpManage em=new EmpManage(); BufferedReader br=new BufferedReader(new
Time of Update: 2015-04-21
標籤:java map 效率 遍曆 引言: 在Java中Map的使用非常頻繁,我們經常會需要對Map進行遍曆和讀取,下面將展示兩種遍曆的方法以及簡要分析。1. 遍曆Map方法A Map map = new HashMap(); Iterator iter = map.entrySet().iterator(); while
Time of Update: 2015-04-21
標籤: 在介紹Hibernate之前,先介紹一下JDBC,Java Data Base Connectivity——Java資料庫連接,是一種用於執行SQL語句的Java API,是一套訪問資料庫的標準,提供了一組介面,可以為多種關聯式資料庫提供統一訪問,是Java語言訪問資料庫用到的東西。
Time of Update: 2015-04-21
標籤:效能最佳化 效能 web伺服器 最佳化 效能概述
Time of Update: 2015-04-22
標籤:資料的讀寫,按照資料類型可以分為兩種:字元流和位元組流(二者區別?)。所以資料讀取方式按照資料類型也可以分為兩類:位元組流的讀取和字元流的讀取。一、位元組流讀取操作:| ||-----1、FileInputStrem和FileInputStream位元組流逐位元組讀寫(速度最慢) |||-----2、FileInputStrem和FileInputStream構造一個緩衝數組進行讀寫(速度提升)||-----3、利用位元組緩衝區流BufferedInputStream和
Time of Update: 2015-04-22
標籤:java 數組 /* * 數組的使用 * 1、資料:相同類型資料的有序結合 * 2、數組的長度是確定的,一旦被建立將無法更改 * 3、數組中的每個元素必須相同,不能出現混合類型 * 4、元素的資料類型可以任意,主要包括基本類型和參考型別 *
Time of Update: 2015-04-22
標籤:官方說法:http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html 為了方便我直接複製過來了,原文如下: Here‘s a list of keywords in the Java programming language. 下面是Java程式設計語言的關鍵字列表。 You cannot use any of the following as
Time of Update: 2015-04-22
標籤:一、軟體測試軟體開發:項目調研--需求分析--軟體設計--程式編碼--軟體測試--運行維護軟體測試:利用測試載入器按照測試方案和流程對產品進行功能和效能測試,使用人工或者自動手段來運行或測試某個系統的過程。目的在於檢驗是否滿足規定的需求,確認預期結果與實際結果之間的差別。墨盒測試-白盒測試-迴歸測試-單元測試二、JUnit-單元測試工具三、測試Junit測試類別建立被測試類別package com.pb.junit;/** *1.建立被測試類別 *2.Junit 3.0或者4.0 這裡有3
Time of Update: 2015-04-22
標籤: 1 package com.xt.thinks21_2; 2 3 import java.util.concurrent.ExecutorService; 4 import java.util.concurrent.Executors; 5 import java.util.concurrent.SynchronousQueue; 6 import java.util.concurrent.ThreadFactory; 7 import
Time of Update: 2015-04-22
標籤: 在說道主題前,先來囉嗦兩句,o()︿︶)o
Time of Update: 2015-04-22
標籤: 1 package com.xt.thinks21_2; 2 3 import java.util.concurrent.TimeUnit; 4 5 /** 6 * 後台線程測試 7 * 8 * @author Administrator 9 *10 */11 public class SimpleDaemonTest implements Runnable {12 13 @Override14 public void run() {15
Time of Update: 2015-04-22
標籤: 順序尋找又稱線性尋找: 基本思想:從尋找表的一端開始,向另一端逐個按給定值K與關鍵字進行比較,若找到,尋找成功; 並給出記錄在表中的位置;若整個表檢測完,仍未找到與K值相同的關鍵字,則尋找失敗; 優點:對錶中資料的儲存沒有要求,對於鏈表,只能進行順序尋找; 缺點:當n值很大時,平均尋找長度較大,效率低; import
Time of Update: 2015-04-22
標籤: 1 package com.xt.thinks21_2; 2 3 import java.util.concurrent.ExecutorService; 4 import java.util.concurrent.Executors; 5 6 /** 7 * java線程優先順序測試 8 * 9 * @author Administrator10 *11 */12 public class ThreadPriorityTest implements Runnable {
Time of Update: 2015-04-22
標籤:import java.math.BigInteger;1.建立一個對象Scanner in = new Scanner(System.in);BigInteger x1 = new BigInteger("-11"); //建立一個對象BigInteger x2 = in.nextBiginteger();//鍵盤輸入BigInteger y = x1.abs(); //取絕對值BigInteger y2 = x1.add(y); //x+yint x3 =
Time of Update: 2015-04-21
標籤:今天遇到一個很狗血的問題,一個功能在開發環境沒有問題,但在生產環境出錯了。代碼如下: ... File
Time of Update: 2015-04-21
標籤:/** * 列印楊輝三角 功能描述:使用多重迴圈列印6階楊輝三角 * @author Administrator * */public class sz_7 {public static void main(String[] args) {Scanner in = new Scanner(System.in);System.out.println("請輸入行號:");int m = in.nextInt();int n = 2*m-1;//列元素數;int arr[][] = new
Time of Update: 2015-04-21
標籤:Create a simple class. Inside a second class, define a reference to an object of the first class. Use lazy initialization to instantiate this object. 1 import static org.greggordon.tools.Print.*; 2 3 class Engine { 4 private String s; 5
Time of Update: 2015-04-21
標籤:1.準備 先下載軟體:Myeclipse:http://www.xiazaiba.com/html/23858.html tomcat:http://files.cnblogs.com/files/linmingjun/apache-tomcat-7.0.59.zip Sql Server