Download presentation
Presentation is loading. Please wait.
Published byRafe Sparks Modified over 9 years ago
1
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling
2
2 Take control of your own learning Lecture Classes Exercises Book Web page Discussion forum Study groups Practice, practice, practice! Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
3
3 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
4
4 Buzzwords interface Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling javadoc encapsulation coupling cohesion polymorphic method calls inheritance mutator methods collection classes overridingiterators responsibility-driven design
5
5 Goals Sound knowledge of programming principles Sound knowledge of object-orientation Able to critically assess the quality of a (small) software system Able to implement a small software system in Java Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
6
6 Book Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling David J. Barnes & Michael Kölling Objects First with Java A Practical Introduction using BlueJ 5th edition, Pearson Education, 2012 ISBN 0-13-249266-0 978-0-13-249266-9
7
7 Course overview (1) Objects and classes Understanding class definitions Object interaction Grouping objects More sophisticated behavior - libraries Designing classes Well-behaved objects - testing, maintaining, debugging Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
8
8 Course overview (2) Inheritance Polymorphism Extendable, flexible class structures Building graphical user interfaces Handling errors Designing applications Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
9
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
10 Objects and classes Classes (noun) –Represent ALL objects of a generic kind or type –eg. a car Objects (proper noun) –Represent ONE specific thing from the real world, or from some domain –eg. the specific red car down there Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
11
11 Methods and parameters Methods (verbs) –Operations invoked on a particular object –eg. drive the red car Parameters (adverbs) –Additional information necessary to execute the method needs to be passed –eg. drive the red car for 10 miles Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
12
12 Other observations Many instances can be created from a single class An object has attributes with 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
13 State Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
14
14 Two circle objects Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
15
15 Source code Each class has its own source code (Java code) Associated with the class are definitions for its details –fields –methods Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
16
16 Return values All the methods in the figures project have void return types; but … … methods may return a result via a return value Such methods have a non- void return type More on this in the next chapter Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
17
17 lab-classes demo Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Class diagram Creating an object (instance) Calling a method –Parameters Data types State of an object (inspector) Multiple instances of a class –Same fields (attributes) –Different states Object interaction
18
18 BlueJ Class Diagram Object Bench Code Pad Terminal Window Source Code Editor
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.