Chapter 6 Objects and Classes Prerequisites for Part II apter 5 Arrays She calls out to the man on the street Sir can you help me Oh think twice hapter 6 Objects and Classes It's another day for you and me In paradise hapter 7 Strin You can cover GUI after Chapter 8 Chapter 8 Inheritance and Polymorphism Chapter 11 Getting Started with GUI Programming Chapter 9 Abstract Classes and Interfaces > Chapter 12 Event-Driven programming Chapter 10 Object-Oriented Modeling hapter 15 Exceptions and Assertions You can cover Exceptions and l/o after Chapter 8 Chapter 16 Simple Input and Output Introduction to Java Programming, revised by Dai-kaiyu
Liang,Introduction to Java Programming,revised by Dai-kaiyu 1 Chapter 6 Objects and Classes Prerequisites for Part II Chapter 6 Objects and Classes Chapter 7 Strings Chapter 8 Inheritance and Polymorphism Chapter 5 Arrays Chapter 9 Abstract Classes and Interfaces Chapter 10 Object-Oriented Modeling Chapter 11 Getting Started with GUI Programming Chapter 12 Event-Driven Programming Chapter 15 Exceptions and Assertions Chapter 16 Simple Input and Output You can cover Exceptions and I/O after Chapter 8 You can cover GUI after Chapter 8 She calls out to the man on the street Sir can you help me … Oh think twice It's another day for you and me In paradise …
Objectives To understand objects and classes and use classes to model objects(s 6.2) o To learn how to declare a class and how to create an object of a class($ 6.3) To understand the roles of constructors and use constructors to create objects (§6.3) To use UML graphical notations to describe classes and objects ($6.3) To distinguish between object reference variables and primitive data type variables (§64) To use classes in the Java library (86.5) To declare private data fields with appropriate get and set methods to make class easy to maintain($6.6-6.8) To develop methods with object arguments($ 6.9) To understand the difference between instance and static variables and methods (§6.10 To determine the scope of variables in the context of a class($6.11) To use the keyword this as the reference to the current object that invokes the instance method($ 6. 12) To store and process objects in arrays($6. 13) To apply class abstraction to develop software($6.14) o To declare inner classes.gqry. to Java Programming, rewsed by Dai-kaiyu
Liang,Introduction to Java Programming,revised by Dai-kaiyu 2 Objectives ⚫ To understand objects and classes and use classes to model objects (§6.2). ⚫ To learn how to declare a class and how to create an object of a class (§6.3). ⚫ To understand the roles of constructors and use constructors to create objects (§6.3). ⚫ To use UML graphical notations to describe classes and objects (§6.3). ⚫ To distinguish between object reference variables and primitive data type variables (§6.4). ⚫ To use classes in the Java library (§6.5). ⚫ To declare private data fields with appropriate get and set methods to make class easy to maintain (§6.6-6.8). ⚫ To develop methods with object arguments (§6.9). ⚫ To understand the difference between instance and static variables and methods (§6.10). ⚫ To determine the scope of variables in the context of a class (§6.11). ⚫ To use the keyword this as the reference to the current object that invokes the instance method (§6.12). ⚫ To store and process objects in arrays (§6.13). ⚫ To apply class abstraction to develop software (§6.14). ⚫ To declare inner classes (§6.17)
OO Programming Concepts Object Oriented Programming(OOP) O Encapsulates data (attributes) and methods (behaviors) o Objects: An object represents an entity in the real world that can be distinctly identified O Allows objects to communicate oWell-defined interfaces Introduction to Java Programming, revised by Dai-kaiyu
Liang,Introduction to Java Programming,revised by Dai-kaiyu 3 OO Programming Concepts ⚫Object Oriented Programming (OOP) Encapsulates data (attributes) and methods (behaviors) ⚫Objects: An object represents an entity in the real world that can be distinctly identified Allows objects to communicate ⚫Well-defined interfaces
OO Programming Concepts o Procedural programming language OC is an example OAction-oriented O Functions are units ofprogramming o Object-oriented programming language O Java is an example OObject-orientec O Classes are units ofprogramming o Functions, or methods, are encapsulated in classes Introduction to Java Programming, revised by Dai-kaiyu
Liang,Introduction to Java Programming,revised by Dai-kaiyu 4 OO Programming Concepts ⚫Procedural programming language C is an example Action-oriented Functions are units of programming ⚫Object-oriented programming language Java is an example Object-oriented Classes are units of programming ⚫Functions, or methods, are encapsulated in classes
OO Programming Concepts o Procedural programming language algrithom data structure o Object-oriented programming language Object t messaging object message Liang, Introduction to Java Programming, rewsed by Dai- kary
Liang,Introduction to Java Programming,revised by Dai-kaiyu 5 OO Programming Concepts ⚫Procedural programming language ⚫Object-oriented programming language Object + messaging algrithom + data structure