Time of Update: 2018-12-06
1.你需要精通物件導向分析與設計(OOA/OOD)、涉及模式(GOF,J2EEDP)以及綜合模式。你應該瞭解UML,尤其是class,object,interaction以 及statediagrams。2.你需要學習JAVA語言的基礎知識以及它的核心類庫(collections,serialization,streams,networking,?multithreading,reflection
Time of Update: 2018-12-06
MainActivity.java/** * @author Administrator * @param 說明可以用代碼控制 布局,不用xml * */public class MainActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
Time of Update: 2018-12-06
Swing API的設計目標是強大、靈活和易用。特別地,我們希望能讓程式員們方便地建立新的Swing組件,不論是從頭開始還是通過擴充我們所提供的一些組件。 出於這個目的,我們不要求Swing組件支援多線程訪問。相反,我們向組件發送請求並在單一線程中執行請求。 本文討論區對話和Swing組件。目的不僅是為了協助你以安全執行緒的方式使用Swing API,而且解釋了我們為什麼會選擇現在這樣的線程方案。 本文包括以下內容:
Time of Update: 2018-12-06
1如何將字串 String 轉換成整數 int? A. 有兩個方法: 1). int i = Integer.parseInt([String]); 或 i = Integer.parseInt([String],[int radix]); 2). int i = Integer.valueOf(my_str).intValue(); 注: 字串轉成 Double, Float, Long 的方法大同小異. 2 如何將整數 int 轉換成字串 String ? A. 有三種方法:
Time of Update: 2018-12-06
1 public class TestSearch{ 2 public static void main(String[] args){ 3 int[] a = new int[]{1,3,6,8,9,10,12,18,20,38}; 4 int x = 23; 5 if(binarySearch(a,x)>0){ 6 System.out.println(binarySearch(a,x)); 7
Time of Update: 2018-12-06
public class Test{public static void main(String[] args){ Date[] days = new Date[5]; days[0] = new Date(2006,5,4); days[1] = new Date(2006,7,4); days[2] = new Date(2008,5,4); days[3] = new Date(2
Time of Update: 2018-12-06
雖然C#和Java之間是兩個平台的競爭,沒有什麼誰更好前途的說法。 但是就語言來說,我覺得C#的程度遠遠比Java高。1.Java程式比.net程式慢得多。三個Java得IDE編譯器,JBuilder,Eclipse和NetBeans,以及編寫PHP用的Zend Studio Development
Time of Update: 2018-12-06
/** * 建立Excel表格 * * @param filename */public static void createExecl(String filename) {Workbook workbook = null;// 產生活頁簿對象if (filename.endsWith(".xls")) {workbook = new HSSFWorkbook();} else {workbook = new XSSFWorkbook();}// 產生工作表對象Sheet sheet =
Time of Update: 2018-12-06
public static void readWord2003(String filename) {InputStream inputStream = null;WordExtractor wordExtractor = null;String word = null;try {inputStream = new FileInputStream(filename);wordExtractor = new WordExtractor(inputStream);word =
Time of Update: 2018-12-06
如何才算掌握Java(J2SE篇)時常看到一些人說掌握了Java,但是讓他們用Java做一個實際的項目可能又困難重重,在這裡,筆者根據自己的一點理解鬥膽提出自己的一些對掌握Java這個說法的標準,當然對於新手,也可以提供一個需要學習哪些內容的參考。另外這個標準僅限於J2SE部分,J2EE部分的內容有時間再另說。1、文法:必須比較熟悉,在寫代碼的時候IDE的編輯器對某一行報錯應該能夠根據報錯資訊知道是什麼樣的語法錯誤並且知道任何修正。 2、命令:必須熟悉JDK帶的一些常用命令及其常用選項,命令至
Time of Update: 2018-12-06
在java中,主要是利用ZipEntry,ZipInputStream和ZipOutputStream來實現zip資料壓縮方式的編程方法,構造方法摘要ZipEntry(String name) 使用指定名稱建立新的 ZIP 條目。構造方法摘要ZipInputStream(InputStream in) 建立新的 ZIP 輸入資料流。構造方法摘要ZipOutputStream(OutputStream out) 建立新的 ZIP
Time of Update: 2018-12-06
1)java集合架構的階層2)使用Collection介面定義的公用方法對集合和線性表操作3)使用Iterator介面遍曆集合4)使用JDK的增強for迴圈替代迭代Iterator進行集合遍曆5)熟悉Set介面,瞭解何時及如何使用HashSet,LinkedHashSet或TreeHashSet來儲存元素6)使用Comparator介面來比較元素7)熟悉List介面,瞭解何時以及如何使用ArrayList或者LinkedList來儲存元素8)區分Vector與ArrayList,並瞭解如何使用V
Time of Update: 2018-12-06
本文中示範如何通過URLConnection擷取Http響應Header資訊1.從響應中獲得Header資訊 URL obj = new URL("http://www.qiyadeng.com"); URLConnection conn = obj.openConnection(); Map<String, List<String>> map =
Time of Update: 2018-12-06
Java繼承時建構函式的關係,先來一道筆試題給大家看看: 在繼承中,關於構造方法的說明,下列說法錯誤的是() A、子類無條件的繼承父類的無參構造方法, B、子類可以引用父類中的有參構造方法,使用super關鍵字, C、如果子類沒有構造方法,則父類無參構造方法作為自已的構造方法,
Time of Update: 2018-12-06
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/import java.io.Console;public class ConsoleLogin { public static void main(String arg[]) { Console con; con = System.console(); if(con == null) {
Time of Update: 2018-12-06
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/import java.net.InetAddress;import java.net.UnknownHostException;import java.io.IOException;public class ShowIP { public static void main(String arg[]) { InetAddress address; try {
Time of Update: 2018-12-06
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/1.簡介:Regex是Java 處理字串、文本的重要工具。java.util.regex.Pattern 匹配類:用模式比對一個字串所表達的抽象結果。java.util.regex.Matcher 模式類:用來表示一個編譯過的Regex。 2.例子import java.util.regex.Pattern; public class RegexDemo1 {
Time of Update: 2018-12-06
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/使用BufferedReader對象的readLine()方法必須處理java.io.IOException異常(Exception).一次可以讀一行:import java.io.FileReader; import java.io.FileWriter; import java.io.BufferedReader; import java.io.BufferedWriter;
Time of Update: 2018-12-06
1.Junit4 標註總結 2.測試方法總結 3.assertThat語句的基本使用該語句是代替原來的Assert 陳述式,以一種可讀性更強的形式呈現斷言。使用時,注意匯入:(Eclipse某些版本不能自動匯入)import static org.junit.Assert.assertThat; import static org.hamcrest.CoreMatchers.*;常用語句如下:allOf語句表示所有在括弧內的測試都必須通過,該斷言才成立。
Time of Update: 2018-12-06
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/話題是由如下的事情引出的:public class StringTest { public static void main(String[] args) { String str1 = new String("abc"); String str2 = "abc"; if (str1 == str2) { System.out.println("str1 == str2