Microsoft Word - JAVA Programming Language Homework I ans

Size: px
Start display at page:

Download "Microsoft Word - JAVA Programming Language Homework I ans"

Transcription

1 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 all constructors with a void return type. B. Declare all constructors using the private access modifier. C. Do not declare any constructors inside a class definition. D. Do not include a return statement in the constructor. E. None of the above. Answer: B 當建構子被定義成 private, 任何的類別, 除了此建構子本身的類別, 誰都無法透過此建構子建立一個新的物件 2. Which of the following statements are true? A. A constructor can invoke the constructor of the direct superclass using the superclass constructor invocation statement super. B. By using constructor invocation statement this, a constructor can invoke another constructor of the same class. C. The constructor invocation statement, this, can legally appear anywhere in the constructor body. D. By using the constructor invocation statement this, a constructor can invoke itself. E. None of the above. Answer: A, B 關鍵字 this 是指本身的類別, 所以可用來呼叫本類別中其他的建構子, 但卻不允許用 this 來呼叫本身 ( 建構子 ) 呼叫建構子的 this 敘述, 必須放在陳述中的第一行 因為 super 代表父類別或 superclass, 所以可用來呼叫父類別的建構子 3. Given the following Java code: 1. public class Hello { 2. String title= ; 3. int value; 4. public Hello( ) {

2 5. title = title + World ; 6. System.out.print(title); 7. } 8. public Hello(int value) { 9. this.value = value; 10. title = Hello ; 11. this( ); 12. } 13. public static void main(string[] args){ 14. Hello b = new Hello (5); 15. } 16. } A. Hello B. Hello World C. Compilation fails D. Hello World 5 E. Hello Hello Answer: C 呼叫建構子的 this 敘述, 必須放在陳述中的第一行 4. Given the following Java code: 1. class Num { 2. public static String b( ) { return One ; } 3. public static String b( int i ) { return Two ; } 4. public static String b( int i, int j ) throws Exception { return Three ; } 5. public static void main( String[] args ) { 6. System.out.println( b(2) ); 7. } 8. } A. One B. Two C. Compilation fails D. Three E. None of the above Answer: B 因為 System.out.println(b(2)) 中的 b(2) 和 public static String b(int i)

3 中的參數列相同 5. Given the following Java code: Exhibit: 1. public class SimpleCalc { 2. public int value; 3. public void calculate( ) { value += 7; } 4. } And: 1. Public class MultiCalc extends SimpleCalc { 2. public void calculate( ) { value -= 3; } 3. public void calculate( int multipier) { 4. calculate( ); 5. super.calculate( ); 6. value *= multipier; 7. } 8. public static void main(string[] args) { 9. MultiCalc calculator = new MultiCalc( ); 10. calculator.calculate(2); 11. System.out.println( Value is: + calculator.value); 12. } 13. } A. Value is: 8 B. Compilation fails. C. Value is: 12 D. Value is: -12 E. The code runs with no output. Answer: A 從 MultiCalc 類別的 main() 開始, 建構出 MultiCalc(), 無傳參數的建構子, 呼叫 calculate(int) 方法再呼叫本類別的 calculate(), 使 value = 0-3 = -3 再呼叫父類別的 calculate(), 使 value = = 4 最後將 value x 傳遞的參數值 2 = 4 * 2 = 8 再度返回 main() 方法, 將該 value 屬性印出 8

4 6. Given the following Java code: 1. public class Base { 2. public static final String FOO = foo ; 3. public static void main(string[] args) { 4. Base b = new Base( ); 5. Sub s = new Sub( ); 6. System.out.println(Base.FOO); 7. System.out.println(Sub.FOO); 8. System.out.println(b.FOO); 9. System.out.println(s.FOO); 10. System.out.println(((Base)s).FOO); 11. } 12. } 13. class Sub extends Base {public static final String FOO= bar ;} A. foofoofoofoofoo B. foobarfoobarbar C. foobarfoofoofoo D. foobarfoobarfoo E. foofoofoobarbar Answer: D Base.FOO 是 class Base 的 static 成員, 所以印出 "foo" Sub.FOO 是 class Sub 的 static 成員, 所以印出 "bar" b.foo 是 class Base 物件, 可以存取 static 成員, 所以印出 "foo" s.foo 是 class Sub 物件, 可以存取 static 成員, 所以印出 "bar" (Base)s 之後成為 Base 物件, 呼叫 Base 的 FOO, 所以印出 "foo" 7. Given the following Java code: 1. public class TestPoly { 2. public static void main(string[] args) { 3. Parent p = new Child( ); 4. } 5. } class Parent { 8. public Parent( ) { 9. super();

5 10. System.out.println( instantiate a parent ); 11. } 12. } class Child extends Parent { 15. public Child( ) { 16. System.out.println( instantiate a child ); 17. } 18. } A. instantiate a child B. instantiate a parent C. instantiate a child instantiate a parent D. instantiate a parent instantiate a child E. Compilation fails Answer: D 在 Child 建構子中的程式執行之前, 類別 Child 的建構子會先呼叫類別 Parent 的建構子, 當 Parent 建構子的程式執行時, 會列印出第一行, 然後再把控制項回傳給 Child 的建構子 8. Given the following Java code: 1. public class TestPoly { 2. public static void main(string[] args) { 3. Parent p = new Child( ); 4. } 5. } class Parent { 8. public Parent( ) { 9. super(); 10. System.out.println( instantiate a parent ); 11. } 12. } class Child extends Parent {

6 15. public Child( ) { 16. System.out.println( instantiate a child ); 17. super( ); 18. } 19. } A. instantiate a child B. instantiate a parent C. instantiate a child instantiate a parent D. instantiate a parent instantiate a child E. Compilation fails Answer: E Line 17 程式會使編譯程式失敗, 對 super() 的呼叫必須放在建構子的第一行陳述式中 9. Given the following Java code: 1. class C { 2. public static void main(string[] args) { 3. A tmp = new B( ); 4. tmp.m1( ); 5. tmp.m2( ); 6. ((B)tmp).m1( ); 7. ((B)tmp).m2( ); 8. } 9. } 10. class A {public void m1( ) { System.out.println ( A );}} 11. class B extends A { 12. public void m1( ) { System.out.println ( B1 );} 13. public void m2( ) { System.out.println ( B2 );} 14. public void m3( ) { System.out.println ( B3 );} 15. public void m4( ) { System.out.println ( B4 );} 16. } A. AB2B1B2 B. B1B2B1B2

7 C. Compiler Error D. Runtime Error E. None of the above Answer: C tmp 的型態為 A, 因為類別 A 中沒有函式 m2, 所以函式的多型不能應用, 亦即無法使用型類為 A 的參照來呼叫類別 B 中的函式 m2 10. Given the following Java code: 1. public class Bootchy { 2. int botch; 3. String snootch; 4. public Bootchy() { 5. this( snootchy ); 6. System.out.print( first ); 7. } 8. public Bootchy(String snootch) { 9. this(420, snootchy ); 10. System.out.print( second ); 11. } 12. public Bootchy(int bootch, String snootch) { 13. this.bootch=botch; 14. this.snootch = snootch; 15. System.out.print( third ); 16. } 17. public static void main(string[] args){ 18. Bootchy b = new Bootchy(); 19. System.out.print(b.snootch + + b.bootch); 20. } 21. } (A) snootchy 420 third second first (B) snootchy 420 first second third (C) first second third snootchy 420 (D) third second first snootchy 420 (E) third first second snootchy 420 Answer: D 建構出 b, 以無傳參數的建構子建構 public Bootchy(), this( "snootchy" ) 呼叫本類別建構子 public Boothchy( String snootch ),

8 this( 420, "snootchy" ) 呼叫本類別建構子 public Bootchy(int bootch, String snootch) 然後 bootch = 420; snootch = "snootchy", 印出 "third", 再度返回 public Boothchy( String snootch ), 印出 "second ", 再度返回 public Bootchy(), 印出 "first", 最後回到 main(), 印出 "snootchy" 與 Given the following Java code: 1. class A { 2. private static int tmp = 1; 3. static void m(int i) { tmp++; i++;} 4. public void n(int i) { tmp = tmp + 2;} 5. static void n() { tmp = tmp + 2;} 6. public static void main(string[] args) { 7. int tmp2 = 3; 8. m(tmp2); 9. System.out.println(tmp +, + tmp2); 10. } 11. } A. 1, 3 B. 2, 3 C. 1, 4 D. 2, 4 E. Compiler Error Answer: B 變數 tmp 和方法 m 都被定義為 static, 所以能直接被其他類別所存取, 第 7 行將 tmp2 設為 3, 第 8 行呼叫 m 並將 tmp 由 1 增加到 2, 而函式的參數 i 並不影響 tmp2 的值, 所以結果為 2, Which of the following are legal identifiers? A. _3variable B. 3_variable C. this D. super E. *variable Answer: A B. 變數字首不可為數字 C.this 為關鍵字 D. super 為關鍵字 E. 變數字首不可為 *

9 13. Which are not primitive types in Java? A. float B. Boolean C. short D. Double E. long Answer: B, D Boolean 和 Double 分別為 boolean 與 double 之 Wrapper Class, 並非 primitive 資料型態 14. Given the following Java code: 1. interface Count { 2. short counter = 0; 3. void countup( ); 4. } 5. public class TestCount implements Count { public static void main(string[] args) { 8. TestCount t = new TestCount( ); 9. t.countup( ); 10. } 11. public void countup( ) { 12. for (int x = 6; x > counter; x--, ++counter) { 13. System.out.println( + counter); 14. } 15. } 16. } A B C D E. Compiler error Answer: E

10 由於 counter 變數是介面變數, 其預設為 final static, 因此程式碼無法編譯 : 當第 12 行的程式碼試圖增加 counter 時, 編譯器便會發生錯誤 15. Given the following Java code: 1. public class ConstOver { 2. public ConstOver(int x, int y, int z) { 3. } 4. } Which two overload the ConstOver constructor? A. ConstOver( ){} B. Protected int ConstOver( ){} C. Private ConstOver(int z, int y, int x){} D. public Object ConstOver(int x, byte y, byte z){} E. public void ConstOver(byte x, byte y, byte z){} Answer: A C B: 有回傳值 int, 是 method 不是建構子 D: 有回傳值 Object, 是 method 不是建構子 E: 回傳值是 void,void 是沒有回傳值的 method 16. Given the following Java code: 1. interface foo { 2. int k = 0; 3. } 4. public class ExamA015 implements foo{ 5. public static void main(string[] args) { 6. int i; 7. ExamA015 test = new ExamA015( ); 8. i = test.k; 9. i = ExamA015.k; 10. i = foo.k; 11. } 12. } A. Compilation succeeds. B. An error at line 2 causes compilation to fail.

11 C. An error at line 9 causes compilation to fail. D. An error at line 10 causes compilation to fail. E. An error at line 11 causes compilation to fail. Answer: A 在 interface 所定義的變數其實就是 final static 變數, 可直接取用 17. Given the following Java code: 1. public class foo { 2. public static void main (String[] args) { 3. String s; 4. System.out.println( s= + s); 5. } 6. } A. The code compiles and s= is printed. B. The code compiles and s=null is printed. C. The code does not compile because string s is not initialized. D. The code does not compile because string s cannot be referenced. E. There is a runtime error. Answer: C String 變數在使用前必須先給定初始值 Java 語言中只有 static 變數 陣列與 Primitive Type 會自動加入初始內容值, 題中 s 屬於非陣列的參考資料型別 (Reference Type)

12 18. Which two statements are true about has-a and is-a relationships? (choose two) A. Inheritance represents an is-a relationship. B. Inheritance represents a has-a relationship. C. Interfaces must be used when creating a has-a relationship. D. Instance variables can be used when creating a has-a relationship. Answer: A D A: 繼承關係表現出 is-a 的關係 : 機車 ( 繼承 ) 車, 所以機車 is-a 車子, 正確 B: 繼承關係表現出 has-a 的關係 : 機車 ( 繼承 ) 車, 機車 has-a 車子是錯的 C: 建立一個 has-a 的關係必須用到介面 : 不一定, 因為機車 has-a 引擎, 並不需要實做任何介面, 因為引擎是另一種物件 D: 建立一個 has-a 的關係可以用到實體變數 : 正確, 因為機車 has-a 引擎的實體變數 19. Which two statements are true? (choose two) A. A final method in class X can be abstract if and only if X is abstract. B. A protected method in class X can be overridden by any subclass of X. C. A private static method can be called only within other static methods in class X. D. A non-static public final method in class X can be overridden in any subclass of X. E. A public static method in class X can be called by a subclass of X without explicitly referencing the class X. Answer: B, E A: final 方法不可能也同時是抽象方法, 所以錯誤 B: 一個 protected 方法是可以被子類別進行 override, 正確 C: 一個 private 的 static 方法只可以被同類別中的 static 方法所呼叫使用? 這是錯誤的 因為其他同類別的 non-static 方法也可以呼叫使用 D: 一個 final non-static 的 public 方法, 可以被該類別的子類別所 overridden? 這是錯誤的, 因為該方法已經是 final, 不可以被任何方式進行 overridden E: 一個 public static 方法可以被該類別之子類別直接參考使用, 正確

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

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

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

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

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

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

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

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入 100 年 特 種 考 試 地 方 政 府 公 務 人 員 考 試 試 題 等 別 : 三 等 考 試 類 科 : 資 訊 處 理 科 目 : 系 統 分 析 與 設 計 一 請 參 考 下 列 旅 館 管 理 系 統 的 使 用 案 例 圖 (Use Case Diagram) 撰 寫 預 約 房 間 的 使 用 案 例 規 格 書 (Use Case Specification), 繪 出 入

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

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

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

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

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc 2 5 8 11 0 13 1. 13 2. 15 3. 18 1 23 1. 23 2. 26 3. 28 2 36 1. 36 2. 39 3. 42 4. 44 5. 49 6. 51 3 57 1. 57 2. 60 3. 64 4. 66 5. 70 6. 75 7. 83 8. 85 9. 88 10. 98 11. 103 12. 108 13. 112 4 115 1. 115 2.

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

Strings

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

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

Microsoft Word - 01.DOC

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

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

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

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

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

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

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

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

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

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

javaexample-02.pdf

javaexample-02.pdf n e w. s t a t i c s t a t i c 3 1 3 2 p u b l i c p r i v a t e p r o t e c t e d j a v a. l a n g. O b j e c t O b j e c t Rect R e c t x 1 y 1 x 2 y 2 R e c t t o S t r i n g ( ) j a v a. l a n g. 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

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj Message Transition 5-1 5-2 DataInputStream Class 5-3 DataOutputStream Class 5-4 PrintStream Class 5-5 (Message Transition) (Exercises) Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream

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

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

The Embedded computing platform

The Embedded computing platform 嵌入式系統及實驗 Embedded System and Experiment 詹曉龍 長庚大學電機系 Java 的類別與物件 : 宣告類別 建構子 public class Customer { private String name; private String address; // Customer 類別宣告 // 成員資料 public int age; // 建構子 : 使用參數設定成員資料初始值

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

<4D6963726F736F667420506F776572506F696E74202D20B5DA3035D5C220C3E6CFF2B6D4CFF3B8DFBCB6B3CCD0F2C9E8BCC6>

<4D6963726F736F667420506F776572506F696E74202D20B5DA3035D5C220C3E6CFF2B6D4CFF3B8DFBCB6B3CCD0F2C9E8BCC6> Java 程 序 设 计 教 学 课 件 河 南 农 业 大 学 信 管 学 院 计 算 机 系 河 南 农 业 大 学 信 管 学 院 计 算 机 系 高 级 语 言 程 序 设 计 课 程 组 第 5 章 面 向 对 象 高 级 程 序 设 计 主 要 内 容 5.1 继 承 5.2 多 态 性 5.3 抽 象 类 和 抽 象 方 法 5.4 接 口 5.5 内 部 类 和 匿 名 类 5.1

More information

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

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

More information

chp6.ppt

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

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

c_cpp

c_cpp C C++ C C++ C++ (object oriented) C C++.cpp C C++ C C++ : for (int i=0;i

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

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 PowerPoint - plan08.ppt

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

More information

《大话设计模式》第一章

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

More information

无类继承.key

无类继承.key 无类继承 JavaScript 面向对象的根基 周爱 民 / aimingoo aiming@gmail.com https://aimingoo.github.io https://github.com/aimingoo rand = new Person("Rand McKinnon",... https://docs.oracle.com/cd/e19957-01/816-6408-10/object.htm#1193255

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

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new ListView 自訂排版 主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new int[]{r.drawable.dog1, R.drawable.dog2,

More information

級 任 介 紹 班 主 任 其 他 級 任 2A 羅 彩 岫 主 任 吳 毅 蕙 老 師 2B 徐 玲 老 師 陳 詠 詩 老 師 2C 梁 麗 興 老 師 尹 南 老 師 2D 曾 康 老 師 李 樂 雯 老 師 2E 黃 蕙 明 老 師

級 任 介 紹 班 主 任 其 他 級 任 2A 羅 彩 岫 主 任 吳 毅 蕙 老 師 2B 徐 玲 老 師 陳 詠 詩 老 師 2C 梁 麗 興 老 師 尹 南 老 師 2D 曾 康 老 師 李 樂 雯 老 師 2E 黃 蕙 明 老 師 李 志 達 紀 念 學 校 15-16 年 度 二 年 級 家 會 級 任 介 紹 班 主 任 其 他 級 任 2A 羅 彩 岫 主 任 吳 毅 蕙 老 師 2B 徐 玲 老 師 陳 詠 詩 老 師 2C 梁 麗 興 老 師 尹 南 老 師 2D 曾 康 老 師 李 樂 雯 老 師 2E 黃 蕙 明 老 師 校 致 辭 讓 學 生 成 為 有 用 的 人 成 才 的 孩 子, 他 們 都 做 過 同

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

OOP with Java 通知 Project 3: 3 月 29 日晚 9 点 4 月 1 日上课

OOP with Java 通知 Project 3: 3 月 29 日晚 9 点 4 月 1 日上课 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 3: 3 月 29 日晚 9 点 4 月 1 日上课 复习 Java 包 创建包 : package 语句, 包结构与目录结构一致 使用包 : import restaurant/ - people/ - Cook.class - Waiter.class - tools/ - Fork.class

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

投影片 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

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

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc 2 5 8 11 0 1. 13 2. 15 3. 18 1 1. 22 2. 25 3. 27 2 1. 35 2. 38 3. 41 4. 43 5. 48 6. 50 3 1. 56 2. 59 3. 63 4. 65 5. 69 13 22 35 56 6. 74 7. 82 8. 84 9. 87 10. 97 11. 102 12. 107 13. 111 4 114 1. 114 2.

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

java2d-4.PDF

java2d-4.PDF 75 7 6 G r a d i e n t P a i n t B a s i c S t r o k e s e t P a i n t ( ) s e t S t o r k e ( ) import java.awt.*; import java.awt.geom.*; public class PaintingAndStroking extends ApplicationFrame { public

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

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

從篤加有二「區」談當代平埔文化復振現相

從篤加有二「區」談當代平埔文化復振現相 從 篤 加 有 二 邱 談 族 群 正 名 運 動 從 篤 加 有 二 邱 談 族 群 正 名 運 動 陳 榮 輝 台 南 女 子 技 術 學 院 通 識 教 育 中 心 講 師 摘 要 本 文 從 篤 加 村 非 平 埔 族 裔 的 正 名 運 動, 探 討 篤 加 村 民 因 不 認 同 廟 後 區 ( 邱 ) 所 形 成 的 平 埔 族 裔 概 念, 從 地 理 變 遷 村 廟 沿 革 族 譜

More information

Microsoft PowerPoint - P766Ch06.ppt

Microsoft PowerPoint - P766Ch06.ppt PHP5&MySQL 程式設計 第 6 章物件導向 6-1 認識物件導向 物件 (object) 或 案例 (instance) 屬性 (property) 欄位 (field) 或 成員變數 (member variable) 方法 (method) 或 成員函式 (member function) 事件 (event) 類別 (class) 物件導向程式設計 (OOP) 具有下列特點 : 封裝

More information

高中英文科教師甄試心得

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

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

運算子多載 Operator Overloading

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

More information

ENGG1410-F Tutorial 6

ENGG1410-F Tutorial 6 Jianwen Zhao Department of Computer Science and Engineering The Chinese University of Hong Kong 1/16 Problem 1. Matrix Diagonalization Diagonalize the following matrix: A = [ ] 1 2 4 3 2/16 Solution The

More information

untitled

untitled Co-integration and VECM Yi-Nung Yang CYCU, Taiwan May, 2012 不 列 1 Learning objectives Integrated variables Co-integration Vector Error correction model (VECM) Engle-Granger 2-step co-integration test Johansen

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

C/C++语言 - C/C++数据

C/C++语言 - C/C++数据 C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;

More information

OOP with Java 通知 Project 4: 推迟至 4 月 25 日晚 9 点

OOP with Java 通知 Project 4: 推迟至 4 月 25 日晚 9 点 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 推迟至 4 月 25 日晚 9 点 复习 Protected 可以被子类 / 同一包中的类访问, 不能被其他类访问 弱化的 private 同时赋予 package access class MyType { public int i; public double d; public

More information

全国计算机技术与软件专业技术资格(水平)考试

全国计算机技术与软件专业技术资格(水平)考试 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明

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

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

時 間 : 180 分 鐘 四 考 試 特 點 (a) 程 式 易 懂 撰 寫 簡 單, 不 必 經 過 長 時 間 的 課 程 訓 練 (b) 物 件 導 向 的 程 式 設 計, 將 重 點 擺 在 資 料 介 面 的 技 巧 (c)java 有 一 個 很 完 善 且 分 散 式 的 程 式

時 間 : 180 分 鐘 四 考 試 特 點 (a) 程 式 易 懂 撰 寫 簡 單, 不 必 經 過 長 時 間 的 課 程 訓 練 (b) 物 件 導 向 的 程 式 設 計, 將 重 點 擺 在 資 料 介 面 的 技 巧 (c)java 有 一 個 很 完 善 且 分 散 式 的 程 式 SCJP(Oracle Certified Professional, Java SE5.0 Programmer) 國 際 能 力 認 證 學 制 / 班 級 : 日 間 部 四 年 制 / 網 通 四 乙 指 導 老 師 : 方 信 普 老 師 學 生 學 號 / 姓 名 :49636108/ 王 順 聖 繳 交 年 月 份 : 民 國 100 年 6 月 一 Java 認 證 和 SCJP5.0

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

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf (%d, & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9 201 201 21 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 1 B 1 C 5 D RPG 10 E 10 F 1 G II 1 1 201 201 C 1 # include 2 int main ( void

More information

Microsoft Word - chap10.doc

Microsoft Word - chap10.doc 78 10. Inheritance in C++ 我 們 已 介 紹 了 物 件 導 向 程 式 的 第 一 個 主 要 特 性, 即 程 式 可 模 組 化 成 為 類 別 ( 物 件 ), 類 別 具 有 資 料 封 裝 的 特 性 接 下 來 我 們 要 介 紹 物 件 導 向 程 式 的 另 一 個 主 要 特 性, 那 就 是 類 別 具 有 繼 承 的 功 能 繼 承 就 是 重 複

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

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074> 程 序 设 计 实 习 INFO130048 3-2.C++ 面 向 对 象 程 序 设 计 重 载 继 承 多 态 和 聚 合 复 旦 大 学 计 算 机 科 学 与 工 程 系 彭 鑫 pengxin@fudan.edu.cn 内 容 摘 要 方 法 重 载 类 的 继 承 对 象 引 用 和 拷 贝 构 造 函 数 虚 函 数 和 多 态 性 类 的 聚 集 复 旦 大 学 计 算 机 科 学

More information

(6) 要 求 付 款 管 理 员 从 预 订 表 中 查 询 距 预 订 的 会 议 时 间 两 周 内 的 预 定, 根 据 客 户 记 录 给 满 足 条 件 的 客 户 发 送 支 付 余 款 要 求 (7) 支 付 余 款 管 理 员 收 到 客 户 余 款 支 付 的 通 知 后, 检

(6) 要 求 付 款 管 理 员 从 预 订 表 中 查 询 距 预 订 的 会 议 时 间 两 周 内 的 预 定, 根 据 客 户 记 录 给 满 足 条 件 的 客 户 发 送 支 付 余 款 要 求 (7) 支 付 余 款 管 理 员 收 到 客 户 余 款 支 付 的 通 知 后, 检 2016 年 上 半 年 软 件 设 计 师 考 试 真 题 ( 下 午 题 ) 下 午 试 题 试 题 一 ( 共 15 分 ) 阅 读 下 列 说 明 和 图, 回 答 问 题 1 至 问 题 4, 将 解 答 填 入 答 题 纸 的 对 应 栏 内 说 明 某 会 议 中 心 提 供 举 办 会 议 的 场 地 设 施 和 各 种 设 备, 供 公 司 与 各 类 组 织 机 构 租 用 场

More information

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

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : ICDL-Excel Title : The ICDL L4 excel exam Version : DEMO 1 / 11 1. Which one of the following formulas would be appropriate to calculate the

More information

untitled

untitled 3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(

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

Chn 116 Neh.d.01.nis

Chn 116 Neh.d.01.nis 31 尼 希 米 书 尼 希 米 的 祷 告 以 下 是 哈 迦 利 亚 的 儿 子 尼 希 米 所 1 说 的 话 亚 达 薛 西 王 朝 二 十 年 基 斯 流 月 *, 我 住 在 京 城 书 珊 城 里 2 我 的 兄 弟 哈 拿 尼 和 其 他 一 些 人 从 犹 大 来 到 书 珊 城 我 向 他 们 打 听 那 些 劫 后 幸 存 的 犹 太 人 家 族 和 耶 路 撒 冷 的 情 形

More information

软件工程文档编制

软件工程文档编制 实训抽象类 一 实训目标 掌握抽象类的定义 使用 掌握运行时多态 二 知识点 抽象类的语法格式如下 : public abstract class ClassName abstract void 方法名称 ( 参数 ); // 非抽象方法的实现代码 在使用抽象类时需要注意如下几点 : 1 抽象类不能被实例化, 实例化的工作应该交由它的子类来完成 2 抽象方法必须由子类来进行重写 3 只要包含一个抽象方法的抽象类,

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 点 复习 Java 包 创建包 : package 语句, 包结构与目录结构一致 使用包 : import restaurant/ - people/ - Cook.class - Waiter.class - tools/ - Fork.class - Table.class

More information

天 主 教 輔 仁 大 學 社 會 學 系 學 士 論 文 小 別 勝 新 婚? 久 別 要 離 婚? 影 響 遠 距 家 庭 婚 姻 感 情 因 素 之 探 討 Separate marital relations are getting better or getting worse? -Exp

天 主 教 輔 仁 大 學 社 會 學 系 學 士 論 文 小 別 勝 新 婚? 久 別 要 離 婚? 影 響 遠 距 家 庭 婚 姻 感 情 因 素 之 探 討 Separate marital relations are getting better or getting worse? -Exp 天 主 教 輔 仁 大 學 社 會 學 系 學 士 論 文 小 別 勝 新 婚? 久 別 要 離 婚? 影 響 遠 距 家 庭 婚 姻 感 情 因 素 之 探 討 Separate marital relations are getting better or getting worse? -Explore the impact of emotional factors couples do not

More information

119,,,,,, (, ), : (1),,,,,, (2),,,, (3),,,,,20,,,,,,,,

119,,,,,, (, ), : (1),,,,,, (2),,,, (3),,,,,20,,,,,,,, 118 :,,, :,,,,,,,,,,,,,,, ( ), 119,,,,,, (, ), : (1),,,,,, (2),,,, (3),,,,,20,,,,,,,, 120 2003 3,19,,,,,,,,,,,,,,,,,,,,,,,,,, 1945 10 15,, 121, 1950,, 1951 7 10, 1952 7 11,,, 60,, 1947 3,,,, 1950 6,7,,,,,,,,

More information

Microsoft PowerPoint - CH 04 Techniques of Circuit Analysis

Microsoft PowerPoint - CH 04 Techniques of Circuit Analysis Chap. 4 Techniques of Circuit Analysis Contents 4.1 Terminology 4.2 Introduction to the Node-Voltage Method 4.3 The Node-Voltage Method and Dependent Sources 4.4 The Node-Voltage Method: Some Special Cases

More information

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

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

More information

FY.DOC

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

More information

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 專題進度 老師 : 趙啟時老師 學生 : 陳建廷 2013/10/13 用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 程式碼 : package com.example.phone; import java.util.arraylist;

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 PowerPoint - 13_ClassAndObj.ppt

Microsoft PowerPoint - 13_ClassAndObj.ppt Visual Basic 2005 (VB.net 2.0) 程式設計 講師 : 戴志華 hana@arbor.ee.ntu.edu.tw 國立台灣大學電機工程研究所 第十三章 物件與類別 物件與類別 物件導向程式設計 物件與類別的建立 物件與類別 物件 (object) Ex. 人 屬性 (property) 身高 體重 血型 方法 (method) 走路 跑步 訊息 (message) 交談 事件

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

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

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

00. - 0-000 0 10 0 00-0 0 11 12 13 14 15 b 16 17 18 19 0 - 20 0 0-0 0 21 22 H.Mead 0-0 - ( ) 23 ( ) 24 ( ) 25 ( ) 26 27 00 0 00 0 28 29 30 31 ( ) 0 0 32 ( ) 33 ( ) 34 ( ) 35 ( ) 36 ( ) ( ) Northrop F.S.C.

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

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

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

More information

A Study on the Relationships of the Co-construction Contract A Study on the Relationships of the Co-Construction Contract ( ) ABSTRACT Co-constructio in the real estate development, holds the quite

More information

untitled

untitled 1 5 IBM Intel 1. IBM 第 1/175 页 第 2/175 页 第 3/175 页 80 第 4/175 页 2. IBM 第 5/175 页 3. (1) 第 6/175 页 第 7/175 页 第 8/175 页 = = 第 9/175 页 = = = = = 第 10/175 页 = = = = = = = = 3. (2) 第 11/175 页 第 12/175 页 第 13/175

More information

A Study on JI Xiaolan s (1724-1805) Life, Couplets and Theories of Couplets 紀 曉 嵐 (1724 1724-1805 1805) 生 平 資 料 斠 正 及 對 聯 聯 論 研 究 LI Ha 李 夏 THE UNIVER

A Study on JI Xiaolan s (1724-1805) Life, Couplets and Theories of Couplets 紀 曉 嵐 (1724 1724-1805 1805) 生 平 資 料 斠 正 及 對 聯 聯 論 研 究 LI Ha 李 夏 THE UNIVER Title A study on Ji Xiaolan's (1724-1805) life, couplets and theories of couplets = Ji Xiaolan (1724-1805) sheng ping zi liao jiao zheng ji dui lian, lian lun yan jiu Author(s) Li, Ha; 李 夏 Citation Li,

More information

穨1-林聖欽.doc

穨1-林聖欽.doc 1 39 92 11 Geographical Research No. 39, November. 2003 * The historical geographical study of the Taiwanese christening culture: A case of Xuei-gia-liau, Xuei-gia Bau, Yan-Shui-Gang Ting in Japanese Rule

More information

1505.indd

1505.indd 上 海 市 孙 中 山 宋 庆 龄 文 物 管 理 委 员 会 上 海 宋 庆 龄 研 究 会 主 办 2015.05 总 第 148 期 图 片 新 闻 2015 年 9 月 22 日, 由 上 海 孙 中 山 故 居 纪 念 馆 台 湾 辅 仁 大 学 和 台 湾 图 书 馆 联 合 举 办 的 世 纪 姻 缘 纪 念 孙 中 山 先 生 逝 世 九 十 周 年 及 其 革 命 历 程 特 展

More information

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un Linux C July 27, 2016 Contents 1 Linux IDE 1 2 GCC 3 2.1 hello.c hello.exe........................... 5 2.2............................... 9 2.2.1 -Wall................................ 9 2.2.2 -E..................................

More information