Lecture 01b Objects First
Lecture 01b Objects First
OF TECHNOLOGY
Stockholm
Sweden
Ric Glassey
[email protected]
Course Contents
2
Buzzwords
inheritance
responsibility
overriding
iterators -driven design
javadoc encapsulation
cohesion interface
coupling
collection classes mutator methods
polymorphic method calls
3
Goals
4
Book
Objects First with Java
A Practical Introduction using BlueJ
David J. Barnes & Michael Kölling
5
Course overview (1)
• Objects and classes
• Understanding class definitions
• Object interaction
• Grouping objects
• More sophisticated behaviour using libraries
• Designing classes
• Well-behaved objects - testing, maintaining, debugging
6
Demo: Figures Project
7
Fundamental concepts
• Object
• Class
• Method
• Parameter
• Data type
8
Objects and classes
• Objects
– represent ‘things’ from the real world, or from some
problem domain (example: “the red car down there in
the car park”)
• Classes
– represent all objects of a kind (example: “car”)
9
Methods and parameters
10
Other observations
11
State
12
Two circle objects
13
Demo: Figures Project
14
Source code
15
Demo: Lab Classes
16
Return values
17
Concept Review
18
*Concept Review*
19
*Concept Review*
20
*Required Reading*
• Chapter One
• Objects First with Java, 5th/6th Edition
21