Page 229 - Introduction to Programming with Java: A Problem Solving Approach
P. 229

                 0.0 Last A-Head 195
CHAPTER 6
    Object-Oriented Programming
Objectives
• Learn what an object is and how it relates to a class.
• Learn how to encapsulate and access data inside an object.
• Learn how to partition your programs into “driver” and “driven” classes, to create an object of the
driven class, and to give the driver a reference to that object.
• Learn the differences between an object’s data and data that is local to a method, and learn how to distinguish between those pieces of data when both have the same name.
• Understand implicit initialization (default values) of various kinds of variables.
• Learn how to trace an object-oriented program.
 Apago PDF Enhancer
• Learn how to use a UML class diagram.
• Learn how to make a method return a suitable value.
• Learn how values are passed to methods.
• Write methods that get, set, and test the values of an object’s data.
• Optionally learn how to improve the speed and accuracy of a simulation.
Outline
 6.1 Introduction
6.2 Object-OrientedProgrammingOverview
6.3 FirstOOPClass
6.4 DriverClass
6.5 CallingObject,thisReference
6.6 InstanceVariables
6.7 Tracing an OOP Program
6.8 UMLClassDiagrams
6.9 LocalVariables
6.10 ThereturnStatement
6.11 ArgumentPassing
6.12 SpecializedMethods—Accessors,Mutators,BooleanMethods
6.13 ProblemSolvingwithSimulation(Optional)
195



































































   227   228   229   230   231