Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Java methods: Object-oriented programming and data structures (2nd AP edition): Chapter 3 - Maria Litvin, Gary Litvin
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Chapter 3 - Objects and classes. This chapter gives an introduction to the main Java and OOP concepts but does not require their full understanding. In terms of grasping the big picture, each student proceeds at his or her own pace. The same concepts are covered later in more depth. Here students get a general idea of how things are put together, get a feel for OOP, and work on exercises that require rearranging small pieces of code. | Objects and Classes Copyright © 2011 by Maria Litvin, Gary Litvin, and Skylight Publishing. All rights reserved. Java Methods Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin 2nd AP edition with GridWorld 3- In this chapter we use the first project from the GridWorld case study to illustrate the main OOP concepts. Objectives: See an example of a GridWorld program, written in OOP style, and discuss the types of objects used in it Learn about the general structure of a class, its fields, constructors, and methods Get a feel for how objects are created and how to call their methods Learn a little about inheritance in OOP 3- This chapter gives an introduction to the main Java and OOP concepts but does not require their full understanding. In terms of grasping the big picture, each student proceeds at his or her own pace. The same concepts are covered later in more depth. Here students get a general idea of how things are put together, get a feel for . | Objects and Classes Copyright © 2011 by Maria Litvin, Gary Litvin, and Skylight Publishing. All rights reserved. Java Methods Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin 2nd AP edition with GridWorld 3- In this chapter we use the first project from the GridWorld case study to illustrate the main OOP concepts. Objectives: See an example of a GridWorld program, written in OOP style, and discuss the types of objects used in it Learn about the general structure of a class, its fields, constructors, and methods Get a feel for how objects are created and how to call their methods Learn a little about inheritance in OOP 3- This chapter gives an introduction to the main Java and OOP concepts but does not require their full understanding. In terms of grasping the big picture, each student proceeds at his or her own pace. The same concepts are covered later in more depth. Here students get a general idea of how things are put together, get a feel for OOP, and work on exercises that require rearranging small pieces of code. OOP An OO program models the application as a world of interacting objects. An object can create other objects. An object can call another object’s (and its own) methods (that is, “send messages”). An object has data fields, which hold values that can change while the program is running. 3- A role play exercise may help students grasp the notion of objects and methods. Objects Can model real-world objects Can represent GUI (Graphical User Interface) components Can represent software entities (events, files, images, etc.) Can represent abstract concepts (for example, rules of a game, a location on a grid, etc.) 3- In Java, numbers and characters are not objects but there are so-called wrapper classes Integer, Double, Character, etc., which represent numbers and characters as objects. Objects in the Bug Runner program Grid Control panel Bugs, flowers, and rocks Message display GridWorld window Locations (in .