Chapter
Chapter
David J. Barnes
Michael Kölling
4.0
Course Contents
• Introduction to object-oriented
programming…
• …with a strong software engineering
foundation…
• …aimed at producing and maintaining
large, high-quality software systems.
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 3
Buzzwords
responsibility-driven design
inheritance encapsulation
iterators overriding
coupling
cohesion javadoc interface
Goals
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 5
Book
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 6
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 7
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 8
Demo
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 9
Fundamental concepts
• object
• class
• method
• parameter
• data type
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 10
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 11
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 12
Other observations
• Many instances can be created from a
single class.
• An object has attributes: values
stored in fields.
• The class defines what fields an
object has, but each object stores its
own set of values (the state of the
object).
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 13
State
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 14
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 15
Source code
• Each class has source code (Java
code) associated with it that defines
its details (fields and methods).
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 16
Return values
• Methods may return a result via a
return value.
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling 17