1、面向对象程序设计教案 付蓉第 1 页面向对象程序设计 Java教案计算机科学学院付蓉面向对象程序设计教案 付蓉第 2 页一 、 教 学 基 本 要 求通 过 学 习 面 向 对 象 程 序 设 计 Java , 要 求 学 生 :1、 掌 握 面 向 对 象 程 序 设 计 。2、 掌 握 Java 开 发 和 运 行 环 境 配 置 。3、 熟 悉 和 掌 握 Java 语 言 英 文 技 术 词 汇 。4、 熟 悉 和 掌 握 Java 程 序 设 计 。5、 掌 握 Java 的 面 向 对 象 程 序 设 计 。6、 掌 握 基 本 的 UML 建 模 。二 、 课 程 教 学 总 计
2、 划1、 学 时 安 排 :本 课 程 总 学 时 56 学 时 , 周 学 时 4 学 时 。总 共 安 排 讲 课 40 学 时 ; 上 机 实 践 16 学 时 。2、 教 材 :Introduction to Java Programming ,Y.Daniel Liang 主编,机械工业出版社,英文第 5 版3、 参 考 资 料 : Java 语 言 程 序 设 计 Y.Daniel Liang 著 王 镁 译 机 械 工 业 出 版 社 。 Java 与 面 向 对 象 程 序 设 计 印 渂 著 清 华 大 学 出 版 社 。三 、 课 程 教 学 方 法1、 教 学 形 式采
3、用 “多 媒 体 教 学 (幻 灯 片 、 Java 程 序 编 辑 、 编 译 、 运 行 )”与 传 统 教 学 ( 板 书 ) 相结 合 的 手 段 , 并 配 合 一 定 的 上 机 实 践 。2、 教 学 过 程以 英 文 教 材 、 多 媒 体 教 学 课 件 和 本 课 程 的 讲 义 为 主 线 , 以 参 考 资 料 为 补 充 , 以“上 机 实 践 ”为 学 生 掌 握 本 课 程 的 重 要 形 式 开 展 教 学 。面向对象程序设计教案 付蓉第 3 页四 、 教 学 内 容本 课 程 的 讲 授 内 容 提 要 、 重 点 、 难 点 以 本 教 案 为 主 ; 具
4、体 的 教 学 内 容 以 英 文 教 材 、 面 向 对 象 程 序 设 计 讲 义 为 主 。Chapter 1 Introduction to Computers, Programs, and Java( 讲 课 2 学 时 ; )教 学 内 容 :介 绍 计 算 机 、 程 序 和 Java 语 言 的 发 展 和 特 点 。教 学 要 求 :1) To review computer basics, programs, and operating systems (1.2-1.4). 2) To represent numbers in binary, decimal, and he
5、xadecimal (1.5 Optional).3) To understand the relationship between Java and the World Wide Web (1.6).4) To know Javas advantages (1.7).5) To distinguish the terms API, IDE, and JDK (1.8).6) To write a simple Java program (1.9).7) To create, compile, and run Java programs (1.10).8) To understand the
6、Java runtime environment (1.10).9) To know the basic syntax of a Java program (1.11).10) To display output on the console and on the dialog box (1.12).难 点 与 重 点 :1) To understand the Java runtime environment 2) To create, compile, and run Java programs (1.10).3) To know the basic syntax of a Java pr
7、ogram作 业 :Chapter 2 Primitive Data Types and Operations( 讲 课 2 学 时 ; 上 机 2 学 时 )教 学 内 容 :面向对象程序设计教案 付蓉第 4 页Java 语 言 语 法 。教 学 要 求 :1) To write Java programs to perform simple calculations (2.2).2) To use identifiers to name variables, constants, methods, and classes (2.3).3) To use variables to store
8、 data (2.4-2.5).4) To program with assignment statements and assignment expressions (2.5).5) To use constants to store permanent data (2.6).6) To declare Java primitive data types: byte, short, int, long, float, double, char, and boolean (2.7 2.10).7) To use Java operators to write expressions (2.7
9、2.10).8) To know the rules governing operand evaluation order, operator precedence, and operator associativity (2.11 2.12).9) To represent a string using the String type. (2.13)10) To obtain input using the JOptionPane input dialog boxes (2.14).11) To obtain input from console (2.16 Optional).12) To
10、 format output using JDK 1.5 printf (2.17). 13) To become familiar with Java documentation, programming style, and naming conventions (2.18).14) To distinguish syntax errors, runtime errors, and logic errors (2.19).15) To debug logic errors (2.20).难 点 与 重 点 :1) To use identifiers to name variables,
11、constants, methods, and classes (2.3).2) To declare Java primitive data types: byte, short, int, long, float, double, char, and boolean (2.7 2.10).3) To use Java operators to write expressions (2.7 2.10).4) To distinguish syntax errors, runtime errors, and logic errors (2.19).5) To debug logic error
12、s作 业 :面向对象程序设计教案 付蓉第 5 页Chapter 3 Control Statements( 讲 课 4 学 时 ; 上 机 2 学 时 )教 学 内 容 :Java 语 言 分 支 语 句 ; 循 环 语 句 。教 学 要 求 :1) To understand the flow of control in selection and loop statements (3.2-3.7).2) To use Boolean expressions to control selection statements and loop statements (3.2-3.7).3) To
13、 implement selection control using if and nested if statements (3.2).4) To implement selection control using switch statements (3.2).5) To write expressions using the conditional operator (3.2).6) To use while, do-while, and for loop statements to control the repetition of statements (3.4).7) To wri
14、te nested loops (3.4).8) To know the similarities and differences of three types of loops (3.5).9) To implement program control with break and continue (3.6).难 点 与 重 点 :1) To understand the flow of control in selection and loop statements (3.2-3.7).2) To implement selection control using if and nest
15、ed if statements (3.2).3) To implement selection control using switch statements (3.2).4) To use while, do-while, and for loop statements to control the repetition of statements (3.4).Chapter 4 Methods( 讲 课 3 学 时 ; 上 机 1 学 时 )教 学 内 容 :方 法 的 定 义 和 调 用 。教 学 要 求 :1) To create methods, invoke methods, a
16、nd pass arguments to a method (4.2-4.4).2) To use method overloading and know ambiguous overloading (4.5).3) To determine the scope of local variables (4.6).面向对象程序设计教案 付蓉第 6 页4) To learn the concept of method abstraction (4.7).5) To know how to use the methods in the Math class (4.8).6) To design an
17、d implement methods using stepwise refinement (4.10).7) To write recursive methods (4.11 Optional).8) To group classes into packages (4.12 Optional).难 点 与 重 点 :1) To create methods, invoke methods, and pass arguments to a method (4.2-4.4).2) To use method overloading and know ambiguous overloading。3
18、) To determine the scope of local variables (4.6).Chapter 5 Arrays( 讲 课 3 学 时 ; 上 机 1 学 时 )教 学 内 容 :数 组 定 义 和 使 用 。教 学 要 求 :1) To describe why an array is necessary in programming (5.1).2) To learn the steps involved in using arrays: declaring array reference variables and creating arrays (5.2).3) T
19、o initialize the values in an array (5.2).4) To simplify programming using JDK 1.5 enhanced for loop (5.2).5) To copy contents from one array to another (5.3).6) To develop and invoke methods with array arguments and return type (5.4-5.5).7) To sort an array using the selection sort algorithm (5.6).
20、8) To search elements using the linear or binary search algorithm (5.7).9) To declare and create multidimensional arrays (5.8).10) To create ragged arrays (5.8.3 Optional).难 点 与 重 点 :1) To learn the steps involved in using arrays: declaring array reference variables and creating arrays (5.2).2) To i
21、nitialize the values in an array (5.2).面向对象程序设计教案 付蓉第 7 页3) To develop and invoke methods with array arguments and return type (5.4-5.5)4) To search elements using the linear or binary search algorithm (5.7).Chapter 6 Objects and Classes( 讲 课 4 学 时 ; 上 机 1 学 时 )教 学 内 容 :类 和 对 象 的 定 义 ;属 性 和 方 法 。教 学
22、 要 求 :1) To understand objects and classes and use classes to model objects (6.2).2) To learn how to declare a class and how to create an object of a class (6.3).3) To understand the roles of constructors and use constructors to create objects (6.3).4) To use UML graphical notations to describe clas
23、ses and objects (6.3).5) To distinguish between object reference variables and primitive data type variables (6.4).6) To use classes in the Java library (6.5).7) To declare private data fields with appropriate get and set methods to make class easy to maintain (6.6-6.8).8) To develop methods with ob
24、ject arguments (6.9).9) To understand the difference between instance and static variables and methods (6.10).10) To determine the scope of variables in the context of a class (6.11).11) To use the keyword this as the reference to the current object that invokes the instance method (6.12). 12) To st
25、ore and process objects in arrays (6.13).13) To apply class abstraction to develop software (6.14).14) To declare inner classes (6.17).难 点 与 重 点 :1) To learn how to declare a class and how to create an object of a class (6.3).面向对象程序设计教案 付蓉第 8 页2) To distinguish between object reference variables and
26、 primitive data type variables (6.4).3) To develop methods with object arguments (6.9).4) To understand the difference between instance and static variables and methods (6.10).5) To use the keyword this as the reference to the current object that invokes the instance method (6.12). 6) To store and p
27、rocess objects in arrays (6.13).Chapter 7 Strings ( 讲 课 2 学 时 ; 上 机 1 学 时 )教 学 内 容 :字 符 串教 学 要 求 :1) To use the String class to process fixed strings (7.2).2) To use the Character class to process a single character (7.3).3) To use the StringBuffer class to process flexible strings (7.4). 4) To use
28、the StringTokenizer class to extract tokens from a string (7.5).5) To know the differences among the String, StringBuffer, and StringTokenizer classes (7.2-7.5).6) To use the JDK 1.5 Scanner class for console input and scan tokens using words as delimiters (7.6).7) To input primitive values and stri
29、ngs from the keyboard using the Scanner class (7.7). 8) To learn how to pass strings to the main method from the command line (7.8).难 点 与 重 点 :1) To use the String class to process fixed strings (7.2).2) To use the StringBuffer class to process flexible strings (7.4). 3) To know the differences amon
30、g the String, StringBuffer, and StringTokenizer classes (7.2-7.5).面向对象程序设计教案 付蓉第 9 页Chapter 8 Inheritance and Polymorphism ( 讲 课 4 学 时 )教 学 内 容 :继 承 与 多 态教 学 要 求 :1) To develop a subclass from a superclass through inheritance (8.2).2) To invoke the superclasss constructors and methods using the supe
31、r keyword (8.3).3) To override methods in the subclass (8.4).4) To explore the useful methods (equals(Object), hashCode(), toString(), finalize(), clone(), and getClass() in the Object class (8.5, 8.11 Optional).5) To comprehend polymorphism, dynamic binding, and generic programming (8.6).6) To desc
32、ribe casting and explain why explicit downcasting is necessary (8.7).7) To understand the effect of hiding data fields and static methods (8.8 Optional).8) To restrict access to data and methods using the protected visibility modifier (8.9).9) To declare constants, unmodifiable methods, and nonexten
33、dable class using the final modifier (8.10). 10) To initialize data using initialization blocks and distinguish between instance initialization and static initialization blocks (8.12 Optioanl).难 点 与 重 点 :1) To develop a subclass from a superclass through inheritance (8.2).2) To invoke the superclass
34、s constructors and methods using the super keyword (8.3).3) To override methods in the subclass (8.4).4) To comprehend polymorphism, dynamic binding, and generic programming (8.6).5) To describe casting and explain why explicit downcasting is necessary (8.7).面向对象程序设计教案 付蓉第 10 页6) To initialize data
35、using initialization blocks and distinguish between instance initialization and static initialization blocks (8.12 Optioanl).Chapter 9 Abstract Classes and Interfaces( 讲 课 2 学 时 ; 上 机 2 学 时 )教 学 内 容 :抽 象 类 与 接 口教 学 要 求 :1) To design and use abstract classes (9.2).2) To process calendar using the Cal
36、endar and GregorianCalendar classes (9.3).3) To declare interfaces to model weak inheritance relationships (9.4).4) To define a natural order using the Comparable interface (9.4).5) To know the similarities and differences between an abstract class and interface (9.4).6) To enable objects cloneable
37、using the Cloneable interface (9.4.4 Optional).7) To use wrapper classes (Byte, Short, Integer, Long, Float, Double, Character, and Boolean) to wrap primitive data values into objects (9.5).8) To create a generic sort method (9.5).9) To simplify programming using JDK 1.5 automatic conversion between
38、 primitive types and wrapper class types (9.6).难 点 与 重 点 :1) To design and use abstract classes (9.2).2) To declare interfaces to model weak inheritance relationships (9.4).3) To define a natural order using the Comparable interface (9.4).4) To know the similarities and differences between an abstra
39、ct class and interface (9.4).5) To use wrapper classes (Byte, Short, Integer, Long, Float, Double, Character, and Boolean) to wrap primitive data values into objects (9.5).面向对象程序设计教案 付蓉第 11 页Chapter 10 Object-Oriented Modeling( 讲 课 1 学 时 )教 学 内 容 :面 向 对 象 建 模教 学 要 求 :1) To become familiar with the p
40、rocess of program development (10.2).2) To learn the relationship types: association, aggregation, composition, strong inheritance, and weak inheritance (10.3).3) To declare classes to represent the relationships among the classes (10.3).4) To design systems by identifying the classes and discoverin
41、g the relationships among these classes (10.4).5) To implement the Rational class and process rational numbers using this class (10.5).6) To design classes that follow the class-design guidelines (10.6).7) To model dynamic behavior using sequence diagrams and statechart diagrams (10.7 Optional)8) To
42、 know the concept of framework-based programming using Java API (10.8).难 点 与 重 点 :1) To become familiar with the process of program development (10.2).2) To learn the relationship types: association, aggregation, composition, strong inheritance, and weak inheritance (10.3).3) To declare classes to r
43、epresent the relationships among the classes (10.3).4) To design classes that follow the class-design guidelines (10.6).Chapter 11 Getting Started with GUI Programming( 讲 课 4 学 时 ; 上 机 2 学 时 )教 学 内 容 :GUI 程 序 设 计 入 门教 学 要 求 :1) To distinguish simple GUI components (11.2).2) To describe the Java GUI
44、API hierarchy (11.3).面向对象程序设计教案 付蓉第 12 页3) To create user interfaces using frames, panels, and simple GUI components (11.4).4) To understand the role of layout managers (11.5).5) To use the FlowLayout, GridLayout, and BorderLayout managers to layout components in a container (11.5).6) To specify col
45、ors and fonts using the Color and Font classes (11.6-11.7).7) To use JPanel as subcontainers (11.8).8) To paint graphics using the paintComponent method on a panel (11.9).9) To draw strings, lines, rectangles, ovals, arcs, and polygons using the drawing methods in the Graphics class (11.9).10) To ce
46、nter display using the FontMetrics Class (11.10). 11) To develop a reusable component MessagePanel to display a message on a panel (11.11). 12) To develop a reusable component StillClock to emulate an analog clock (11.12 Optional).难 点 与 重 点 :1) To describe the Java GUI API hierarchy (11.3).2) To cre
47、ate user interfaces using frames, panels, and simple GUI components (11.4).3) To understand the role of layout managers (11.5).4) To use the FlowLayout, GridLayout, and BorderLayout managers to layout components in a container (11.5).Chapter 12 Event-Driven Programming( 讲 课 1 学 时 )教 学 内 容 :事 件 驱 动教
48、学 要 求 :1) To explain the concept of event-driven programming (12.2). 2) To understand event, event source, and event classes (12.2).3) To declare listener classes and write the code to handle events (11.3).4) To register listener objects in the source object (11.3).面向对象程序设计教案 付蓉第 13 页5) To understan
49、d how an event is handled (11.3).6) To write programs to deal with ActionEvent (11.3).7) To write programs to deal with MouseEvent (11.4).8) To write programs to deal with KeyEvent (11.5).9) To use the Timer class to control animations (11.6 Optional).难 点 与 重 点 :1) To write programs to deal with ActionEvent (11.3).2) To write programs to deal with MouseEvent (11.4).3) To wr