Microsoft PowerPoint - ch15.ppt

Size: px
Start display at page:

Download "Microsoft PowerPoint - ch15.ppt"

Transcription

1 Exception Handling Exception handling Exception Indication of problem during execution E.g., divide by zero Chained exceptions 1 Exception-Handling Overview Uses of exception handling Process exceptions from program components Handle exceptions in a uniform manner in large projects Remove error-handling code from main line of execution A method detects an error and throws an exception Exception handler processes the error Uncaught exceptions yield adverse effects Might terminate program execution 2 1

2 Exception-Handling Overview Code that could generate errors put in try blocks Code for error handling enclosed in a catch clause The finally clause always executes Termination model of exception handling The block in which the exception occurs expires throws clause specifies exceptions method throws Divide by Zero Common programming mistake Throws ArithmeticException 3 程式錯誤的分類 程式的錯誤可以依照性質分成三種 : 編譯期錯誤 : 編譯時所發生的錯誤, 經常是語法錯 執行期錯誤 : 在編譯程式的過程中不容易發現, 常在程式執行的過程中發生的錯誤 邏輯錯誤 : 程式設計者在設計程式時, 所發生的邏輯上的問題 4 2

3 Java 例外的繼承關係 錯誤或例外都是 java.lang.throwable 的延伸類別 Error 及其延伸類別 : 其為嚴重的錯誤, 通常捕捉到也無法處理, 因此也很少去捕捉 Exception 及其延伸類別 ( 不包含 RuntimeException 及其延伸類別 ): 這類例外在一般情況很可能發生, 大多屬於環境問題 RuntimeException 及其延伸類別 : 此類例外為程式的執行期錯誤, 例如, 某數除以 0 陣列索引值超出範圍等 5 java.lang.object java.lang.throwable java.lang.error java.lang.virtualmachineerror java.lang.exception java.io.ioexception java.lang.classnotfoundexception java.lang.runtimeexception java.lang.arithmeticexception java.lang.arraystoreexception java.lang.illegalargumentexception java.lang.numberformatexception java.lang.illegalstateexception java.lang.indexoutofboundsexception java.lang.arrayindexoutofboundsexception java.lang.stringindexoutofboundsexception java.lang.nullpointerexception 6 3

4 RuntimeException 常見的 RuntimeException(Unchecked Exception) 執行期例外 ArithmeticException ArrayIndexOutOfBoundsException NegativeArraySizeException NullPointerException NumberFormatException 說明 數學運算時的例外 例如 : 某數除以 0 陣列索引值超出範圍 陣列的大小為負數 物件參照為 null, 並使用物件成員時所產生的例外 數值格式不符所產生的例外 // set up label and inputfield2; register listener 29 container.add( new JLabel( "Enter denominator and press Enter ", 30 SwingConstants.RIGHT ) ); 31 inputfield2 = new JTextField(); 32 container.add( inputfield2 ); 33 inputfield2.addactionlistener( this ); // set up label and outputfield 36 container.add( new JLabel( "RESULT ", SwingConstants.RIGHT ) ); 37 outputfield = new JTextField(); 38 container.add( outputfield ); setsize( 425, 100 ); 41 setvisible( true ); } // end DivideByZeroTest constructor // process GUI events 46 public void actionperformed( ActionEvent event ) 47 { 48 outputfield.settext( "" ); // clear outputfield // read two numbers and calculate quotient 51 try { 52 number1 = Integer.parseInt( inputfield1.gettext() ); 53 number2 = Integer.parseInt( inputfield2.gettext() ); DivideByZeroTest.j ava Line 51 Lines

5 54 55 result = quotient( number1, number2 ); 56 outputfield.settext( String.valueOf( result ) ); 57 } // process improperly formatted input 60 catch ( NumberFormatException numberformatexception ) { 61 JOptionPane.showMessageDialog( this, 62 "You must enter two integers", "Invalid Number Format", 63 JOptionPane.ERROR_MESSAGE ); 64 } // process attempts to divide by zero 67 catch ( ArithmeticException arithmeticexception ) { 68 JOptionPane.showMessageDialog( this, 69 arithmeticexception.tostring(), "Arithmetic Exception", 70 JOptionPane.ERROR_MESSAGE ); 71 } } // end method actionperformed // demonstrates throwing an exception when a divide-by-zero occurs 76 public int quotient( int numerator, int denominator ) 77 throws ArithmeticException 78 { 79 return numerator / denominator; 80 } DivideByZeroTest.j ava Line 55 Line 60 Line 67 Line public static void main( String args[] ) 83 { 84 DivideByZeroTest application = new DivideByZeroTest(); 85 application.setdefaultcloseoperation( JFrame.EXIT_ON_CLOSE ); 86 } } // end class DivideByZeroTest DivideByZeroTest.j ava 5

6 Superclass Throwable Java Exception Hierarchy Subclass Exception Exceptional situations Should be caught by program Subclass Error Typically not caught by program Checked exceptions Catch or declare Unchecked exceptions 11 Inheritance hierarchy for class Throwable Throwable Exception Error RuntimeException IOException AWTError ThreadDeath OutOfMemoryError 12 6

7 Rethrowing an Exception Rethrow exception if catch cannot handle it 13 finally Clause Resource leak Caused when resources are not released by a program The finally block Appears after catch blocks Always executes Use to release resources 14 7

8 1 // Fig. 15.3: UsingExceptions.java 2 // Demonstration of the try-catch-finally exception handling mechanism. 3 public class UsingExceptions { 4 5 public static void main( String args[] ) 6 { 7 try { 8 throwexception(); // call method throwexception 9 } // catch Exceptions thrown by method throwexception 12 catch ( Exception exception ) { 13 System.err.println( "Exception handled in main" ); 14 } doesnotthrowexception(); 17 } // demonstrate try/catch/finally 20 public static void throwexception() throws Exception 21 { 22 // throw an exception and immediately catch it 23 try { 24 System.out.println( "Method throwexception" ); 25 throw new Exception(); // generate exception 26 } UsingExceptions.ja va // catch exception thrown in try block 29 catch ( Exception exception ) { 30 System.err.println( 31 "Exception handled in method throwexception" ); 32 throw exception; // rethrow for further processing // any code here would not be reached 35 } // this block executes regardless of what occurs in try/catch 38 finally { 39 System.err.println( "Finally executed in throwexception" ); 40 } // any code here would not be reached } // end method throwexception // demonstrate finally when no exception occurs 47 public static void doesnotthrowexception() 48 { 49 // try block does not throw an exception 50 try { 51 System.out.println( "Method doesnotthrowexception" ); 52 } UsingExceptions.ja va Line 32 Lines

9 53 54 // catch does not execute, because no exception thrown 55 catch ( Exception exception ) { 56 System.err.println( exception ); 57 } // this clause executes regardless of what occurs in try/catch 60 finally { 61 System.err.println( 62 "Finally executed in doesnotthrowexception" ); 63 } System.out.println( "End of method doesnotthrowexception" ); } // end method doesnotthrowexception } // end class UsingExceptions UsingExceptions.ja va Lines Method throwexception Exception handled in method throwexception Finally executed in throwexception Exception handled in main Method doesnotthrowexception Finally executed in doesnotthrowexception End of method doesnotthrowexception try{ // 例外測試區 } catch( 例外型別例外名 ){ // 例外處理區 } try-catch 敘述 try-catch 敘述用以捕捉並處理例外 只要是 Throwable 或其延伸類別之物件, 都可以使用 try-catch 敘述捕捉 18 9

10 多個 catch 區塊 try-catch 敘述可以使用多個 catch 區塊 try { // 例外測試區 } catch( 例外型別 1 例外名 1){ // 例外處理區 1 } catch( 例外型別 2 例外名 2){ // 例外處理區 2 }... catch( 例外型別 N 例外名 N){ // 例外處理區 N } 19 多個 catch 區塊 頂多只會有一個 catch 區塊內的敘述被執行 特化的例外型別需放在較前的 catch 敘述內 20 10

11 Call Stack 機制 方法之間的呼叫是依循呼叫堆疊機制 (Call Stack Mechanism) a() b() 在 main() 內呼叫 a() 在 a() 內呼叫 b() a() main() main() main() b() a() b() a() b() 結束回到 a() a() a() 結束回到 main() main() main() main() 21 Call Stack 機制 例外與呼叫堆疊機制 在 c() 發生例外 c() b() a() c() b() a() c() 無處理則結束將例外丟給 b() b() a() b() 無處理則結束將例外丟給 a() a() a() 無處理則結束將例外丟給 main() main() main() main() main() 22 11

12 不論有沒有例外發生,finally 區塊內的敘述皆會執行 try { // 例外測試區 } catch( 例外型別例外名 ) { // 例外處理區 } finally { // 鐵定執行區 } finally 區塊 23 finally 區塊 finally 區塊不會執行或不會完全執行 : 有其它例外在 finally 區塊中發生 在 try 或 catch 區塊使用 System.exit() 離開程式 未執行至 finally 區塊, 執行緒即進入結束狀態 (dead state) 24 12

13 Stack Unwinding Exception not caught in scope Method terminates Stack unwinding occurs Another attempt to catch exception 25 1 // Fig. 15.4: UsingExceptions.java 2 // Demonstration of stack unwinding. 3 public class UsingExceptions { 4 5 public static void main( String args[] ) 6 { 7 // call throwexception to demonstrate stack unwinding 8 try { 9 throwexception(); 10 } // catch exception thrown in throwexception 13 catch ( Exception exception ) { 14 System.err.println( "Exception handled in main" ); 15 } 16 } // throwexception throws exception that is not caught in this method 19 public static void throwexception() throws Exception 20 { 21 // throw an exception and catch it in main 22 try { 23 System.out.println( "Method throwexception" ); 24 throw new Exception(); // generate exception 25 } 26 UsingExceptions.ja va Line 9 Line 13 Line 19 Line 24 13

14 27 // catch is incorrect type, so Exception is not caught 28 catch ( RuntimeException runtimeexception ) { 29 System.err.println( 30 "Exception handled in method throwexception" ); 31 } // finally clause always executes 34 finally { 35 System.err.println( "Finally is always executed" ); 36 } } // end method throwexception } // end class UsingExceptions UsingExceptions.ja va Method throwexception Finally is always executed Exception handled in main printstacktrace, getstacktrace and getmessage Throwable class Method printstacktrace Prints method call stack Method getstacktrace Obtains stack-trace information Method getmessage Returns descriptive string 28 14

15 以 throw 丟出例外物件 使用 throw 敘述在程式中丟出例外物件 throw 例外物件 ; 丟出一包含訊息的自訂例外物件 : throw new RuntimeException( 除數為零 ); throw new Exception( 找不到檔案 ); throw 所丟出的例外物件同樣可以使用 try-catch 敘述處理 29 throws 關鍵字 throws 關鍵字使用於方法或建構子定義的標頭, 用來指出例外發生時, 由方法 ( 或建構子 ) 丟出的例外型別 throws 之後可以接多個例外型別名, 表示方法執行過程中可能丟出屬於這些例外型別的物件 方法不可以使用 throw 丟出不包含在 throws 宣告的例外型別之物件 30 15

16 throws 關鍵字 發生 Checked Exception 時須遵守處理或宣告丟出法則 (The Handle or Declare Rule ): 不是以 try-catch-finally 敘述處理就是以 throws 宣告丟出 31 1 // Fig. 15.5: UsingExceptions.java 2 // Demonstrating getmessage and printstacktrace from class Exception. 3 public class UsingExceptions { 4 5 public static void main( String args[] ) 6 { 7 try { 8 method1(); // call method1 9 } // catch Exceptions thrown from method1 12 catch ( Exception exception ) { 13 System.err.println( exception.getmessage() + "\n" ); 14 exception.printstacktrace(); // obtain the stack-trace information 17 StackTraceElement[] traceelements = exception.getstacktrace(); System.out.println( "\nstack trace from getstacktrace:" ); 20 System.out.println( "Class\t\tFile\t\t\tLine\tMethod" ); // loop through traceelements to get exception description 23 for ( int i = 0; i < traceelements.length; i++ ) { 24 StackTraceElement currentelement = traceelements[ i ]; 25 System.out.print( currentelement.getclassname() + "\t" ); 26 System.out.print( currentelement.getfilename() + "\t" ); UsingExceptions.ja va Line 8 Lines Lines

17 27 System.out.print( currentelement.getlinenumber() + "\t" ); 28 System.out.print( currentelement.getmethodname() + "\n" ); } // end for statement } // end catch } // end method main // call method2; throw exceptions back to main 37 public static void method1() throws Exception 38 { 39 method2(); 40 } // call method3; throw exceptions back to method1 43 public static void method2() throws Exception 44 { 45 method3(); 46 } // throw Exception back to method2 49 public static void method3() throws Exception 50 { 51 throw new Exception( "Exception thrown in method3" ); 52 } UsingExceptions.ja va Lines Line 37 Line 39 Line 43 Line 45 Line 49 Line } // end class Using Exceptions Exception thrown in method3 java.lang.exception: Exception thrown in method3 at UsingExceptions.method3(UsingExceptions.java:51) at UsingExceptions.method2(UsingExceptions.java:45) at UsingExceptions.method1(UsingExceptions.java:39) at UsingExceptions.main(UsingExceptions.java:8) UsingExceptions.ja va Stack trace from getstacktrace: Class File Line Method UsingExceptions UsingExceptions.java 51 method3 UsingExceptions UsingExceptions.java 45 method2 UsingExceptions UsingExceptions.java 39 method1 UsingExceptions UsingExceptions.java 8 main 17

18 Chained Exceptions Wraps existing exception in a new exception enables exception to maintain complete stacktrace 35 1 // Fig. 15.6: UsingChainedExceptions.java 2 // Demonstrating chained exceptions. 3 public class UsingChainedExceptions { 4 5 public static void main( String args[] ) 6 { 7 try { 8 method1(); // call method1 9 } // catch Exceptions thrown from method1 12 catch ( Exception exception ) { 13 exception.printstacktrace(); 14 } 15 } // call method2; throw exceptions back to main 18 public static void method1() throws Exception 19 { 20 try { 21 method2(); // call method2 22 } // catch Exception thrown from method2 25 catch ( Exception exception ) { 26 throw new Exception( "Exception thrown in method1", exception ); UsingChainedExcept ions.java Line 8 Lines Line 18 Line 21 Line 26 18

19 27 } 28 } // call method3; throw exceptions back to method1 31 public static void method2() throws Exception 32 { 33 try { 34 method3(); // call method3 35 } // catch Exception thrown from method3 38 catch ( Exception exception ) { 39 throw new Exception( "Exception thrown in method2", exception ); 40 } 41 } // throw Exception back to method2 44 public static void method3() throws Exception 45 { 46 throw new Exception( "Exception thrown in method3" ); 47 } } // end class Using Exceptions UsingChainedExcept ions.java Line 31 Line 34 Line 39 Line 46 java.lang.exception: Exception thrown in method1 at UsingChainedExceptions.method1(UsingChainedExceptions.java:26) at UsingChainedExceptions.main(UsingChainedExceptions.java:8) Caused by: java.lang.exception: Exception thrown in method2 at UsingChainedExceptions.method2(UsingChainedExceptions.java:39) at UsingChainedExceptions.method1(UsingChainedExceptions.java:21)... 1 more Caused by: java.lang.exception: Exception thrown in method3 at UsingChainedExceptions.method3(UsingChainedExceptions.java:46) at UsingChainedExceptions.method2(UsingChainedExceptions.java:34)... 2 more UsingChainedExcept ions.java 19

20 Declaring New Exception Types Extend existing exception class Constructors and Exception Handling Throw exception if constructor causes error 39 Assertion 斷言 (Assertion) 是 J2SE 1.4 新增的功能, 其目的是為了方便程式的除錯 斷言的用處是在於去除邏輯上的錯誤 40 20

21 第一種斷言的宣告語法 : assert 布林運算式 ; 斷言的宣告 布林運算式的運算結果必須為布林值, 否則在程式編譯時會發生錯誤 布林運算式的結果若為 false, 則斷言將丟出一個沒有任何錯誤訊息的 AssertionError 物件 AssertionError 類別屬於 java.lang 套件, 為 Error 類別的子類別 41 斷言的宣告 第二種斷言的宣告語法 : assert 布林運算式 : 訊息運算式 ; 布林運算式為 false 時, 會丟出 AssertionError 物件 AssertionError 物件所包含的錯誤訊息是由訊息運算式所構成 訊息運算式結果通常為 String 物件, 其運算結果不可以是 void( 回傳型別為 void 的方法 ) 42 21

22 啟動斷言功能 斷言是 J2SE 1.4 新增的功能, 所以程式裡包含斷言敘述時, 必須使用 1.4 以上的編譯器版本編譯 使用 -source 參數指明編譯出來的 bytecode 為 1.4 版 : C:\>javac source 1.4 FileName.java 43 啟動斷言功能 執行時, 使用 -enableassertions 或 -ea 參數, 指明啟動斷言功能 : C:\>java -ea FileName 沒有使用 -enableassertions 或 -ea 啟動斷言功能, 則程式中的斷言敘述會被解譯器忽略 一般只有在程式測試時 ( 軟體開發過程 ), 才會開啟斷言功能 44 22

23 資源回收者 Garbage Collector 在程式一開始執行時就會監視 (trace) 每一個變數和物件實體, 當物件實體不被參考時, 此物件實體即成為 Unreachable Object JVM 你的程式變數 Garbage Collector 物件實體一 物件實體二 45 資源回收者 當物件不再被參照變數 (reference variable) 參考 (refer) 時, 它就會被認為是不再使用的 garbage Double d = new Double(0.5); d = new Double(0.2); d = null; 46 23

24 資源回收者 Double d = new Double(0.5); d = new Double(0.2); d = null; d Double 物件值 :0.5 d Double 物件值 :0.5 d null Double 物件值 :0.5 Double 物件值 :0.2 Double 物件值 : 資源回收者 Unreachable Object 佔用的資源並不一定馬上就會被釋放 資源釋放和執行環境 ( 可用記憶體多寡,CPU 繁忙程度等 ) 有關, 程式設計者無法預測或決定資源何時被釋放 執行資源回收的動作只能被建議, 程式設計者無法強迫 (force) 資源回收的執行 48 24

25 finalize() 方法 Garbage Collection 機制在終結物件並釋放記憶體之前, 會先呼叫物件中的 finalize() 方法 finalize() 方法定義於 Object 類別, 不過為空方法, 主要是讓延伸類別覆蓋之用 protected void finalize()throws Throwable finalize() 方法不提供多載的功能 而且 finalize() 不接受傳入參數及回傳值, 所以一律以 void 定義, 並且無參數 49 25

chp6.ppt

chp6.ppt Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行

More information

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6:

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6: Chapter 15. Suppressed Exception CH14 Finally Block Java SE 7 try-with-resources JVM cleanup try-with-resources JVM cleanup cleanup Java SE 7 Throwable getsuppressed Throwable[] getsuppressed() Suppressed

More information

3.1 num = 3 ch = 'C' 2

3.1 num = 3 ch = 'C' 2 Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:

More information

Microsoft PowerPoint - 13_Exception.ppt

Microsoft PowerPoint - 13_Exception.ppt 1 第 13 章例外處理 (Exception Handling) 13.1 簡介 13.2 例外處理概觀 13.3 其它錯誤處理技術 13.4 簡單的例外處理範例 - 除 0 錯誤 13.5 重新丟出例外 13.6 函式例外清單 13.7 處理非預期例外 13.8 堆疊返回 13.9 建構子, 解構子, 與例外處理 13.10 例外與繼承 13.11 處理新的錯誤 13.12 auto_ptr 類別與動態記憶體配置

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

2/80 2

2/80 2 2/80 2 3/80 3 DSP2400 is a high performance Digital Signal Processor (DSP) designed and developed by author s laboratory. It is designed for multimedia and wireless application. To develop application

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 1Z0-854 Title : Java Standard Edition 5 Programmer Certified Professional Upgrade Exam Version : Demo 1 / 12 1.Given: 20. public class CreditCard

More information

Microsoft Word - 投影片ch13

Microsoft Word - 投影片ch13 Java2 JDK5.0 教學手冊第三版洪維恩編著博碩文化出版書號 pg20210 第十三章例外處理 本章學習目標了解什麼是例外處理認識例外類別的繼承架構認識例外處理的機制學習如何撰寫例外類別 例外處理 13-2 13.1 例外的基本觀念 在執行程式時, 經常發生一些不尋常的狀況 例如 : (1) 要開啟的檔案不存在 (2) 陣列的索引值超過了陣列容許的範圍 (3) 使用者輸入錯誤 Java 把這類不尋常的狀況稱為

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Java application Java main applet Web applet Runnable Thread CPU Thread 1 Thread 2 Thread 3 CUP Thread 1 Thread 2 Thread 3 ,,. (new) Thread (runnable) start( ) CPU (running) run ( ) blocked CPU sleep(

More information

Microsoft Word - JAVA Programming Language Homework I ans

Microsoft Word - JAVA Programming Language Homework I ans JAVA Programming Language Homework I - OO concept Student ID: Name: 1. Which of the following techniques can be used to prevent the instantiation of a class by any code outside of the class? A. Declare

More information

投影片 1

投影片 1 資料庫管理程式 ( 補充教材 -Part2) 使用 ADO.NET 連結資料庫 ( 自行撰寫程式碼 以實現新增 刪除 修改等功能 ) Private Sub InsertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InsertButton.Click ' 宣告相關的 Connection

More information

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, http://debut.cis.nctu.edu.tw/~chi Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, : POSITIVE_INFINITY NEGATIVE_INFINITY

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum

More information

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6 www.brainysoft.net 1.JasperReport ireport...4 1.1 JasperReport...4 1.2 ireport...4 2....4 2.1 JDK...4 2.1.1 JDK...4 2.1.2 JDK...5 2.1.3 JDK...5 2.2 ant...6 2.2.1 ant...6 2.2.2 ant...6 2.3 JasperReport...7

More information

《大话设计模式》第一章

《大话设计模式》第一章 第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜

More information

Microsoft Word - ch04三校.doc

Microsoft Word - ch04三校.doc 4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear

More information

untitled

untitled 4.1AOP AOP Aspect-oriented programming AOP 來說 AOP 令 理 Cross-cutting concerns Aspect Weave 理 Spring AOP 來 AOP 念 4.1.1 理 AOP AOP 見 例 來 例 錄 Logging 錄 便 來 例 行 留 錄 import java.util.logging.*; public class HelloSpeaker

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes What is a JavaBean? JavaBean Java JavaBean Java JavaBean JComponent tooltiptext font background foreground doublebuffered border preferredsize minimumsize maximumsize JButton. Swing JButton JButton() JButton(String

More information

EJB-Programming-3.PDF

EJB-Programming-3.PDF :, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

基于CDIO一体化理念的课程教学大纲设计

基于CDIO一体化理念的课程教学大纲设计 Java 语 言 程 序 设 计 课 程 教 学 大 纲 Java 语 言 程 序 设 计 课 程 教 学 大 纲 一 课 程 基 本 信 息 1. 课 程 代 码 :52001CC022 2. 课 程 名 称 :Java 语 言 程 序 设 计 3. 课 程 英 文 名 称 :Java Programming 4. 课 程 类 别 : 理 论 课 ( 含 实 验 上 机 或 实 践 ) 5. 授

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-055Big5 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : Demo 1 / 22 1. 11. public static void parse(string str)

More information

JBuilder Weblogic

JBuilder Weblogic JUnit ( bliu76@yeah.net) < >6 JUnit Java Erich Gamma Kent Beck JUnit JUnit 1 JUnit 1.1 JUnit JUnit java XUnit JUnit 1.2 JUnit JUnit Erich Gamma Kent Beck Erich Gamma Kent Beck XP Extreme Programming CRC

More information

Java 1 Java String Date

Java 1 Java String Date JAVA SCJP Java 1 Java String Date 1Java 01 Java Java 1995 Java Java 21 Java Java 5 1-1 Java Java 1990 12 Patrick Naughton C++ C (Application Programming Interface API Library) Patrick Naughton NeXT Stealth

More information

Microsoft PowerPoint - Lecture7II.ppt

Microsoft PowerPoint - Lecture7II.ppt Lecture 8II SUDOKU PUZZLE SUDOKU New Play Check 軟體實作與計算實驗 1 4x4 Sudoku row column 3 2 } 4 } block 1 4 軟體實作與計算實驗 2 Sudoku Puzzle Numbers in the puzzle belong {1,2,3,4} Constraints Each column must contain

More information

Microsoft Word - Learn Objective-C.doc

Microsoft Word - Learn Objective-C.doc Learn Objective C http://cocoadevcentral.com/d/learn_objectivec/ Objective C Objective C Mac C Objective CC C Scott Stevenson [object method]; [object methodwithinput:input]; output = [object methodwithoutput];

More information

Microsoft Word - 11.doc

Microsoft Word - 11.doc 除 錯 技 巧 您 將 於 本 章 學 到 以 下 各 項 : 如 何 在 Visual C++ 2010 的 除 錯 工 具 控 制 下 執 行 程 式? 如 何 逐 步 地 執 行 程 式 的 敘 述? 如 何 監 看 或 改 變 程 式 中 的 變 數 值? 如 何 監 看 程 式 中 計 算 式 的 值? 何 謂 Call Stack? 何 謂 診 斷 器 (assertion)? 如 何

More information

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class 踩地雷遊戲 高慧君南港高中 開啟專案 MineSweep 任務一 : 產生 30X20 個磚塊編輯 Table 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.arraylist; Write a description of class MyWorld

More information

Microsoft PowerPoint - L17_Inheritance_v4.pptx

Microsoft PowerPoint - L17_Inheritance_v4.pptx C++ Programming Lecture 17 Wei Liu ( 刘 威 ) Dept. of Electronics and Information Eng. Huazhong University of Science and Technology May. 2015 Lecture 17 Chapter 20. Object-Oriented Programming: Inheritance

More information

untitled

untitled 1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 ives.net@gmail.com www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立

More information

Learning Java

Learning Java Java Introduction to Java Programming (Third Edition) Prentice-Hall,Inc. Y.Daniel Liang 2001 Java 2002.2 Java2 2001.10 Java2 Philip Heller & Simon Roberts 1999.4 Java2 2001.3 Java2 21 2002.4 Java UML 2002.10

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

More information

C++ 程式設計

C++ 程式設計 C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004

More information

Microsoft Word - JAVA Programming Language Homework VI_ans.doc

Microsoft Word - JAVA Programming Language Homework VI_ans.doc JAVA Programming Language Homework VI: Threads & I/O ID: Name: 1. When comparing java.io.bufferedwriter to java.io.filewriter, which capability exists as a method in only one of the two? A. Closing the

More information

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit Tomcat Web JUnit Cactus JUnit Java Cactus JUnit 26.1 JUnit Java JUnit JUnit Java JSP Servlet JUnit Java Erich Gamma Kent Beck xunit JUnit boolean JUnit Java JUnit Java JUnit Java 26.1.1 JUnit JUnit How

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

Microsoft Word - 物件導向編程精要.doc

Microsoft Word - 物件導向編程精要.doc Essential Object-Oriented Programming Josh Ko 2007.03.11 object-oriented programming C++ Java OO class object OOP Ruby duck typing complexity abstraction paradigm objects objects model object-oriented

More information

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 JAVA 程 序 设 计 ( 肆 ) 徐 东 / 数 学 系 使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 使 用 Java class 代 表 保 险 箱 public class SaveBox 类 名 类 类 体 实 现 封 装 性 使 用 class SaveBox 代 表 保

More information

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO CHAPTER 使用 Hadoop 打造自己的雲 8 8.3 測試 Hadoop 雲端系統 4 Nodes Hadoop Map Reduce Hadoop WordCount 4 Nodes Hadoop Map/Reduce $HADOOP_HOME /home/ hadoop/hadoop-0.20.2 wordcount echo $ mkdir wordcount $ cd wordcount

More information

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2 Chapter 02 變數與運算式 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.2 2.2.1 2.2.2 2.2.3 type 2.2.4 2.3 2.3.1 print 2.3.2 input 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 + 2.4.6 Python Python 2.1 2.1.1 a p p l e b e a r c 65438790

More information

untitled

untitled 1 MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/ Object object 參 類 都 object 參 object Boxing 參 boxing

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

untitled

untitled 1 Outline ArrayList 類 列類 串類 類 類 例 理 MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/ Object object

More information

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 9 [P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10 C / C++ C C++ C C++ C++ C ( ) C++

More information

A Preliminary Implementation of Linux Kernel Virus and Process Hiding

A Preliminary Implementation of Linux Kernel Virus and Process Hiding 邵 俊 儒 翁 健 吉 妍 年 月 日 学 号 学 号 学 号 摘 要 结 合 课 堂 知 识 我 们 设 计 了 一 个 内 核 病 毒 该 病 毒 同 时 具 有 木 马 的 自 动 性 的 隐 蔽 性 和 蠕 虫 的 感 染 能 力 该 病 毒 获 得 权 限 后 会 自 动 将 自 身 加 入 内 核 模 块 中 劫 持 的 系 统 调 用 并 通 过 简 单 的 方 法 实 现 自 身 的

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B 25 9 2008 9 M ICROEL ECTRON ICS & COMPU TER Vol. 25 No. 9 September 2008 J ava 1,2, 1,2, 1,2 (1, 330022 ; 2, 330022) :,. Apla - Java,,.. : PAR ;Apla - Java ; ;CMP ; : TP311 : A : 1000-7180 (2008) 09-0018

More information

Microsoft PowerPoint - SE7ch10.ppt

Microsoft PowerPoint - SE7ch10.ppt 第十章例外處理 課前指引通常讀者學習到本章時, 已經有一些撰寫程式的經驗, 您是否覺得當程式實際運作時, 常常會發生一些非預期的錯誤呢? 先別煩惱,Java 為了這些問題提出了解決之道, 本章將為您解決這些問題 章節大綱 10.1 什麼是例外 10.2 例外的種類 10.6 例外的處理與轉交 10.7 巢狀例外 10.3 例外的引發 10.4 例外的處理 10.8 重新丟出例外 10.9 本章回顧

More information

Microsoft Word - (web)_F.1_Notes_&_Application_Form(Chi)(non-SPCCPS)_16-17.doc

Microsoft Word - (web)_F.1_Notes_&_Application_Form(Chi)(non-SPCCPS)_16-17.doc 聖 保 羅 男 女 中 學 學 年 中 一 入 學 申 請 申 請 須 知 申 請 程 序 : 請 將 下 列 文 件 交 回 本 校 ( 麥 當 勞 道 33 號 ( 請 以 A4 紙 張 雙 面 影 印, 並 用 魚 尾 夾 夾 起 : 填 妥 申 請 表 並 貼 上 近 照 小 學 五 年 級 上 下 學 期 成 績 表 影 印 本 課 外 活 動 表 現 及 服 務 的 證 明 文 件 及

More information

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题 2009 年 3 月 全 国 计 算 机 等 级 考 试 笔 试 试 卷 二 级 Java 语 言 程 序 设 计 ( 考 试 时 间 90 分 钟, 满 分 100 分 ) 一 选 择 题 ( 每 题 2 分, 共 70 分 ) 下 列 各 题 A) B) C) D) 四 个 选 项 中, 只 有 一 个 选 项 是 正 确 的 请 将 正 确 选 项 填 涂 在 答 题 卡 相 应 位 置 上,

More information

untitled

untitled JavaEE+Android - 6 1.5-2 JavaEE web MIS OA ERP BOSS Android Android Google Map office HTML CSS,java Android + SQL Sever JavaWeb JavaScript/AJAX jquery Java Oracle SSH SSH EJB+JBOSS Android + 1. 2. IDE

More information

Microsoft Word - CX VMCO 3 easy step v1.doc

Microsoft Word - CX VMCO 3 easy step v1.doc Abacus Fully Automated Process of VMCO on CX, KA, CPH & KAH 16 Nov 2009 To streamline the VMCO handling on CX, KA, CPH & KAH, Abacus is pleased to inform you that manual submission of VMCO to CX/KA/CPH/KAH

More information

JavaIO.PDF

JavaIO.PDF O u t p u t S t ream j a v a. i o. O u t p u t S t r e a m w r i t e () f l u s h () c l o s e () public abstract void write(int b) throws IOException public void write(byte[] data) throws IOException

More information

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING 前言 - Andrew Payne 目录 1 2 Firefly Basics 3 COMPONENT TOOLBOX 目录 4 RESOURCES 致谢

More information

内 容 简 介 本 书 是 一 本 关 于 语 言 程 序 设 计 的 教 材, 涵 盖 了 语 言 的 基 本 语 法 和 编 程 技 术, 其 中 包 含 了 作 者 对 语 言 多 年 开 发 经 验 的 总 结, 目 的 是 让 初 学 的 读 者 感 受 到 语 言 的 魅 力, 并 掌

内 容 简 介 本 书 是 一 本 关 于 语 言 程 序 设 计 的 教 材, 涵 盖 了 语 言 的 基 本 语 法 和 编 程 技 术, 其 中 包 含 了 作 者 对 语 言 多 年 开 发 经 验 的 总 结, 目 的 是 让 初 学 的 读 者 感 受 到 语 言 的 魅 力, 并 掌 语 言 程 序 设 计 郑 莉 胡 家 威 编 著 清 华 大 学 逸 夫 图 书 馆 北 京 内 容 简 介 本 书 是 一 本 关 于 语 言 程 序 设 计 的 教 材, 涵 盖 了 语 言 的 基 本 语 法 和 编 程 技 术, 其 中 包 含 了 作 者 对 语 言 多 年 开 发 经 验 的 总 结, 目 的 是 让 初 学 的 读 者 感 受 到 语 言 的 魅 力, 并 掌 握 语

More information

Microsoft Word - 200612-582.doc

Microsoft Word - 200612-582.doc Drools 规 则 引 擎 在 实 现 业 务 逻 辑 中 的 应 用 刘 际 赵 广 利 大 连 海 事 大 学, 大 连 (116026) E-mail:henterji@gmail.com 摘 要 : 现 今, 企 业 级 java 应 用 中 的 业 务 逻 辑 越 来 越 复 杂, 而 这 些 复 杂 的 业 务 逻 辑 又 广 泛 的 分 布 在 应 用 程 序 中 无 论 是 软 件

More information

D C 93 2

D C 93 2 D9223468 3C 93 2 Java Java -- Java UML Java API UML MVC Eclipse API JavadocUML Omendo PSPPersonal Software Programming [6] 56 8 2587 56% Java 1 epaper(2005 ) Java C C (function) C (reusability) eat(chess1,

More information

Microsoft Word - 苹果脚本跟我学.doc

Microsoft Word - 苹果脚本跟我学.doc AppleScript for Absolute Starters 2 2 3 0 5 1 6 2 10 3 I 13 4 15 5 17 6 list 20 7 record 27 8 II 32 9 34 10 36 11 44 12 46 13 51 14 handler 57 15 62 63 3 AppleScript AppleScript AppleScript AppleScript

More information

K301Q-D VRT中英文说明书141009

K301Q-D VRT中英文说明书141009 THE INSTALLING INSTRUCTION FOR CONCEALED TANK Important instuction:.. Please confirm the structure and shape before installing the toilet bowl. Meanwhile measure the exact size H between outfall and infall

More information

Microsoft Word - template.doc

Microsoft Word - template.doc HGC efax Service User Guide I. Getting Started Page 1 II. Fax Forward Page 2 4 III. Web Viewing Page 5 7 IV. General Management Page 8 12 V. Help Desk Page 13 VI. Logout Page 13 Page 0 I. Getting Started

More information

untitled

untitled 1 行 行 行 行.NET 行 行 類 來 行 行 Thread 類 行 System.Threading 來 類 Thread 類 (1) public Thread(ThreadStart start ); Name 行 IsAlive 行 行狀 Start 行 行 Suspend 行 Resume 行 行 Thread 類 (2) Sleep 行 CurrentThread 行 ThreadStart

More information

C/C++ 语言 - 循环

C/C++ 语言 - 循环 C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf

More information

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F 1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o

More information

Mac Java import com.apple.mrj.*;... public class MyFirstApp extends JFrame implements ActionListener, MRJAboutHandler, MRJQuitHandler {... public MyFirstApp() {... MRJApplicationUtils.registerAboutHandler(this);

More information

2015年4月11日雅思阅读预测机经(新东方版)

2015年4月11日雅思阅读预测机经(新东方版) 剑 桥 雅 思 10 第 一 时 间 解 析 阅 读 部 分 1 剑 桥 雅 思 10 整 体 内 容 统 计 2 剑 桥 雅 思 10 话 题 类 型 从 以 上 统 计 可 以 看 出, 雅 思 阅 读 的 考 试 话 题 一 直 广 泛 多 样 而 题 型 则 稳 中 有 变 以 剑 桥 10 的 test 4 为 例 出 现 的 三 篇 文 章 分 别 是 自 然 类, 心 理 研 究 类,

More information

Microsoft PowerPoint - EmbSys101_Java Basics.ppt [相容模式]

Microsoft PowerPoint - EmbSys101_Java Basics.ppt [相容模式] Java Basics Hi Hsiao-Lung Chan, Ph.D. Dept Electrical Engineering Chang Gung University, Taiwan chanhl@maili.cgu.edu.twcgu 執行環境 - eclipse 點選 eclipse 軟體執行檔 設定工作路徑 eclipse 開啟 2 建置 Java 專案 File New project

More information

DbC vs. Exception

DbC vs. Exception DbC vs. Exception 契约式设计 vs. 异常 Exception 问题 何谓 异常 (Exception)? 一种情况要 异常 到什么程度才算 异常? 为什么要引入异常处理机制? Robustness? Readability? 如何进行异常处理? Mandatory or Optional 不同的认识, 不同的答案 Java/C++/C# Eiffel Java Exception

More information

中国人民大学商学院本科学年论文

中国人民大学商学院本科学年论文 RUC-BK-113-110204-11271374 2001 11271374 1 Nowadays, an enterprise could survive even without gaining any profit. However, once its operating cash flow stands, it is a threat to the enterprise. So, operating

More information

尽 管 Java 语 言 是 在 C++ 语 言 基 础 上 发 展 起 来 的, 但 是 有 别 于 C++,Java 是 一 种 纯 粹 的 面 向 对 象 语 言 (Object-oriented language) 在 像 Java 这 样 纯 粹 的 面 向 对 象 语 言 中, 所 有

尽 管 Java 语 言 是 在 C++ 语 言 基 础 上 发 展 起 来 的, 但 是 有 别 于 C++,Java 是 一 种 纯 粹 的 面 向 对 象 语 言 (Object-oriented language) 在 像 Java 这 样 纯 粹 的 面 向 对 象 语 言 中, 所 有 玩 转 Object 不 理 解, 就 无 法 真 正 拥 有 歌 德 按 其 实 而 审 其 名, 以 求 其 情 ; 听 其 言 而 查 其 累, 无 使 放 悖 ( 根 据 实 际 明 辨 名 称, 以 便 求 得 真 实 情 况 ; 听 取 言 辞 后 弄 明 它 的 类 别, 不 让 它 混 淆 错 乱 ) 三 玩 转 Object 大 围 山 人 玩 转 Object...1 1. 通

More information

Windows XP

Windows XP Windows XP What is Windows XP Windows is an Operating System An Operating System is the program that controls the hardware of your computer, and gives you an interface that allows you and other programs

More information

運算子多載 Operator Overloading

運算子多載 Operator Overloading 多型 Polymorphism 講師 : 洪安 1 多型 編譯時期多型 ( 靜態多型 ) function overloading 如何正確呼叫同名的函數? 利用參數個數與型態 operator overloading 其實同 function overloading 執行時期多型 ( 或動態多型 ) 如何正確呼叫不同物件的相同名稱的成員函數 利用繼承與多型 2 子類別與父類別物件間的指定 (assignment)

More information

INTRODUCTION TO COM.DOC

INTRODUCTION TO COM.DOC How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU mahler@ms16.hinet.net This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX

More information

第7章-并行计算.ppt

第7章-并行计算.ppt EFEP90 10CDMP3 CD t 0 t 0 To pull a bigger wagon, it is easier to add more oxen than to grow a gigantic ox 10t 0 t 0 n p Ts Tp if E(n, p) < 1 p, then T (n) < T (n, p) s p S(n,p) = p : f(x)=sin(cos(x))

More information

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO Car DVD New GUI IR Flow User Manual V0.1 Jan 25, 2008 19, Innovation First Road Science Park Hsin-Chu Taiwan 300 R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 Web: www.sunplus.com Important Notice SUNPLUS

More information

OOP with Java 通知 Project 4: 5 月 2 日晚 9 点

OOP with Java 通知 Project 4: 5 月 2 日晚 9 点 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 5 月 2 日晚 9 点 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double x) { d =

More information

软件测试(TA07)第一学期考试

软件测试(TA07)第一学期考试 一 判 断 题 ( 每 题 1 分, 正 确 的, 错 误 的,20 道 ) 1. 软 件 测 试 按 照 测 试 过 程 分 类 为 黑 盒 白 盒 测 试 ( ) 2. 在 设 计 测 试 用 例 时, 应 包 括 合 理 的 输 入 条 件 和 不 合 理 的 输 入 条 件 ( ) 3. 集 成 测 试 计 划 在 需 求 分 析 阶 段 末 提 交 ( ) 4. 单 元 测 试 属 于 动

More information

高中英文科教師甄試心得

高中英文科教師甄試心得 高 中 英 文 科 教 師 甄 試 心 得 英 語 學 系 碩 士 班 林 俊 呈 高 雄 市 立 高 雄 高 級 中 學 今 年 第 一 次 參 加 教 師 甄 試, 能 夠 在 尚 未 服 兵 役 前 便 考 上 高 雄 市 立 高 雄 高 級 中 學 專 任 教 師, 自 己 覺 得 很 意 外, 也 很 幸 運 考 上 後 不 久 在 與 雄 中 校 長 的 會 談 中, 校 長 的 一 句

More information

1 C++ 2 Bjarne Stroustrup C++ (system programming) 6 (infrastructure) C++ 7 Herb Sutter 8 C++ (efficiency) (flexibility) 9 (abstraction) (productivity

1 C++ 2 Bjarne Stroustrup C++ (system programming) 6 (infrastructure) C++ 7 Herb Sutter 8 C++ (efficiency) (flexibility) 9 (abstraction) (productivity 1 C++ 1 C++ Primer C++ (giantchen@gmail.com) 2012-7-11 Creative Commons - - 3.0 Unported (cc by-nc-nd) http://creativecommons.org/licenses/by-nc-nd/3.0/ 1 C++ 2009 Stanley Lippman C++ C++ Java/C#/Python

More information

untitled

untitled ArcGIS Server Web services Web services Application Web services Web Catalog ArcGIS Server Web services 6-2 Web services? Internet (SOAP) :, : Credit card authentication, shopping carts GIS:, locator services,

More information

穨control.PDF

穨control.PDF TCP congestion control yhmiu Outline Congestion control algorithms Purpose of RFC2581 Purpose of RFC2582 TCP SS-DR 1998 TCP Extensions RFC1072 1988 SACK RFC2018 1996 FACK 1996 Rate-Halving 1997 OldTahoe

More information

Microsoft PowerPoint - plan08.ppt

Microsoft PowerPoint - plan08.ppt 程 序 设 计 语 言 原 理 Principle of Programming Languages 裘 宗 燕 北 京 大 学 数 学 学 院 2012.2~2012.6 8. 面 向 对 象 为 什 么 需 要 面 向 对 象? OO 语 言 的 发 展 面 向 对 象 的 基 本 概 念 封 装 和 继 承 初 始 化 和 终 结 处 理 动 态 方 法 约 束 多 重 继 承 总 结 2012

More information

入學考試網上報名指南

入學考試網上報名指南 入 學 考 試 網 上 報 名 指 南 On-line Application Guide for Admission Examination 16/01/2015 University of Macau Table of Contents Table of Contents... 1 A. 新 申 請 網 上 登 記 帳 戶 /Register for New Account... 2 B. 填

More information

附录J:Eclipse教程

附录J:Eclipse教程 附 录 J:Eclipse 教 程 By Y.Daniel Liang 该 帮 助 文 档 包 括 以 下 内 容 : Eclipse 入 门 选 择 透 视 图 创 建 项 目 创 建 Java 程 序 编 译 和 运 行 Java 程 序 从 命 令 行 运 行 Java Application 在 Eclipse 中 调 试 提 示 : 在 学 习 完 第 一 章 后 使 用 本 教 程 第

More information

<4D6963726F736F667420506F776572506F696E74202D20C8EDBCFEBCDCB9B9CAA6D1D0D0DEBDB2D7F92E707074>

<4D6963726F736F667420506F776572506F696E74202D20C8EDBCFEBCDCB9B9CAA6D1D0D0DEBDB2D7F92E707074> 软 件 架 构 师 研 修 讲 座 胡 协 刚 软 件 架 构 师 UML/RUP 专 家 szjinco@public.szptt.net.cn 中 国 软 件 架 构 师 网 东 软 培 训 中 心 小 故 事 : 七 人 分 粥 当 前 软 件 团 队 的 开 发 现 状 和 面 临 的 问 题 软 件 项 目 的 特 点 解 决 之 道 : 从 瀑 布 模 型 到 迭 代 模 型 解 决 项

More information

Collection of 2012 Examination Certificates

Collection of 2012 Examination Certificates 本 局 檔 號 領 取 香 港 年 考 度 試 及 評 通 核 告 局 請 各 與 考 學 校 委 派 職 員 中 學 文 憑 年 考 試 月 / 高 級 日 第 程 四 度 號 會 月 考 證 書 附 外 ), 夾 的 於 領 辦 取 公 單 時 到 間 本 ( 局 星 辦 期 事 一 處 ( 至 地 五 址 :: 上 香 港 )/ 灣 時 香 仔 港 軒 高 分 尼 級 至 詩 程 下 道 度

More information

中 文 摘 要 智 慧 型 手 機 由 於 有 強 大 的 功 能, 以 及 優 渥 的 便 利 性, 還 能 與 網 路 保 持 隨 時 的 鏈 結 與 同 步 更 新, 因 此 深 受 廣 大 消 費 者 喜 愛, 當 然, 手 機 遊 戲 也 成 為 現 代 人 不 可 或 缺 的 娛 樂 之

中 文 摘 要 智 慧 型 手 機 由 於 有 強 大 的 功 能, 以 及 優 渥 的 便 利 性, 還 能 與 網 路 保 持 隨 時 的 鏈 結 與 同 步 更 新, 因 此 深 受 廣 大 消 費 者 喜 愛, 當 然, 手 機 遊 戲 也 成 為 現 代 人 不 可 或 缺 的 娛 樂 之 臺 北 市 大 安 高 級 工 業 職 業 學 校 資 訊 科 一 百 零 一 學 年 度 專 題 製 作 報 告 ------ 以 Android 製 作 ------ ----- 連 線 塔 防 遊 戲 ------ Tower defense game using Internet technology 班 級 : 資 訊 三 甲 組 別 : A9 組 組 員 : 葉 冠 麟 (9906129)

More information

Swing-02.pdf

Swing-02.pdf 2 J B u t t o n J T e x t F i e l d J L i s t B u t t o n T e x t F i e l d L i s t J F r a m e 21 2 2 Swing C a n v a s C o m p o n e n t J B u t t o n AWT // ToolbarFrame1.java // java.awt.button //

More information

Android Service

Android Service Android Service- 播放音樂 建國科技大學資管系 饒瑞佶 2013/7 V1 Android Service Service 是跟 Activity 並行 一個音樂播放程式若沒使用 Service, 即使按 home 鍵畫面離開之後, 音樂還是照播 如果再執行一次程式, 新撥放的音樂會跟先前撥放的一起撥, 最後程式就會出錯 執行中的程式完全看不到! 但是, 寫成 Service 就不同了

More information

OOP with Java 通知 Project 4: 4 月 19 日晚 9 点

OOP with Java 通知 Project 4: 4 月 19 日晚 9 点 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 19 日晚 9 点 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double x) { d

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

RunPC2_.doc

RunPC2_.doc PowerBuilder 8 (5) PowerBuilder Client/Server Jaguar Server Jaguar Server Connection Cache Thin Client Internet Connection Pooling EAServer Connection Cache Connection Cache Connection Cache Connection

More information

Strings

Strings Inheritance Cheng-Chin Chiang Relationships among Classes A 類 別 使 用 B 類 別 學 生 使 用 手 機 傳 遞 訊 息 公 司 使 用 金 庫 儲 存 重 要 文 件 人 類 使 用 交 通 工 具 旅 行 A 類 別 中 有 B 類 別 汽 車 有 輪 子 三 角 形 有 三 個 頂 點 電 腦 內 有 中 央 處 理 單 元 A

More information

目次 

目次  軟 體 工 程 期 末 報 告 網 路 麻 將 91703014 資 科 三 黃 偉 嘉 91703024 資 科 三 丘 祐 瑋 91703030 資 科 三 江 致 廣 1 目 次 壹 前 言 (Preface) P.4 貳 計 畫 簡 述 及 預 期 效 益 (Project Description and Expected Results) P.4 參 系 統 開 發 需 求 (System

More information

Microsoft PowerPoint - course2.ppt

Microsoft PowerPoint - course2.ppt Java 程 式 設 計 基 礎 班 (2) 莊 坤 達 台 大 電 信 所 網 路 資 料 庫 研 究 室 Email: doug@arbor.ee.ntu.edu.tw Class 2 1 回 顧 Eclipse 使 用 入 門 Class 2 2 Lesson 2 Java 程 式 語 言 介 紹 Class 2 3 Java 基 本 知 識 介 紹 大 小 寫 有 差 (Case Sensitive)

More information

VHDL(Statements) (Sequential Statement) (Concurrent Statement) VHDL (Architecture)VHDL (PROCESS)(Sub-program) 2

VHDL(Statements) (Sequential Statement) (Concurrent Statement) VHDL (Architecture)VHDL (PROCESS)(Sub-program) 2 VHDL (Statements) VHDL(Statements) (Sequential Statement) (Concurrent Statement) VHDL (Architecture)VHDL (PROCESS)(Sub-program) 2 (Assignment Statement) (Signal Assignment Statement) (Variable Assignment

More information

基于ECO的UML模型驱动的数据库应用开发1.doc

基于ECO的UML模型驱动的数据库应用开发1.doc ECO UML () Object RDBMS Mapping.Net Framework Java C# RAD DataSetOleDbConnection DataGrod RAD Client/Server RAD RAD DataReader["Spell"].ToString() AObj.XXX bug sql UML OR Mapping RAD Lazy load round trip

More information