1 / 11

OOAD & UML 範例 — 三國演義

OOAD & UML 範例 — 三國演義. 類別的 Java 版. 劉備 class 劉備 { 孔明 k = new 孔明 (); 關羽 g = new 關羽 (); void 迎戰曹操 () { k. 擬定戰略 (); g. 防守荊州 (); k. 聯合孫權 (); } }. 孔明 class 孔明 { 孫權 s = new 孫權 (); void 擬定戰略 () { } void 聯合孫權 () { s. 請領兵相助 ();

pancho
Download Presentation

OOAD & UML 範例 — 三國演義

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OOAD & UML 範例 — 三國演義

  2. 類別的Java版 • 劉備 class 劉備 { 孔明 k = new 孔明(); 關羽 g = new 關羽(); void 迎戰曹操() { k.擬定戰略(); g.防守荊州(); k.聯合孫權(); } } • 孔明 class 孔明{ 孫權 s = new 孫權(); void 擬定戰略() { } void 聯合孫權() { s.請領兵相助(); s.借東風火攻(); } void 借東風火攻(){ } }

  3. 類別的Java版(續) • 關羽 class 關羽 { 張飛 j = new 張飛(); void 防守荊州() { j.防守荊州前線(); } } • 張飛 class 張飛{ void 防守荊州前線() { } }

More Related