Download presentation
Presentation is loading. Please wait.
1
COS 260 DAY 2 Tony Gauvin
2
Agenda Class roll call Blackboard Web Resources
General Information about class Assignment 1 posted Due September 15 Miniquiz 1 September 5 30 min, open book Less than 10 questions over chapter 1 Objects and classes
3
Class Documents Syllabus Contract on Classroom behavior
Class Slides 11/30/2018
4
Additional Course Documents
Contract on Classroom Behavior UMFK Academic Integrity Policy UMFK Faculty Position on Academic Decorum UMS Student Conduct Code
5
Web Resources Java Website (Oracle) JGrasp Blackboard
Textbook Web Site Java Website (Oracle) BlueJ JGrasp Other Useful Sites
6
Objects First with Java A Practical Introduction using BlueJ
David J. Barnes Michael Kölling Replace this with your course title and your name/contact details. 6.0 © David J. Barnes and Michael Kölling
7
Objects First with Java
Course Contents Introduction to object-oriented programming… …with a strong software engineering foundation… …aimed at producing and maintaining large, high-quality software systems. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved. © David J. Barnes and Michael Kölling
8
Objects First with Java
Buzzwords responsibility-driven design inheritance encapsulation iterators overriding coupling cohesion javadoc interface collection classes mutator methods polymorphic method calls © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved. © David J. Barnes and Michael Kölling
9
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 © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
10
Book David J. Barnes & Michael Kölling Objects First with Java A Practical Introduction using BlueJ 6th edition, Pearson Education, 2017 © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
11
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 © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
12
Course overview (2) Inheritance Polymorphism
Extendable, flexible class structures Building graphical user interfaces Handling errors Designing applications © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
13
Advanced material There is advanced material on:
Streams; Chap 5 Lambdas; Chap 5 2D arrays; Chap 7 This may be skipped on first reading … ... or read, according to preference! © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
14
Classes and objects Fundamental to much of the early parts of this course. Class: category or type of ‘thing’. Like a template or blueprint. Object: belongs to a particular class and has individual characteristics. Explore through BlueJ … © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
15
Demo of figures project
Objects First with Java Demo of figures project Here, I start discussing objects and classes. I talk to the students about it for a while, then I do an extensive demo of the shapes example in BlueJ. All important points of this lecture are encountered and pointed out during this demo. All following slides serve only as summary, or reminder. No new material is introduced after the demo. figures.zip © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved. © David J. Barnes and Michael Kölling
16
Objects First with Java
Fundamental concepts It is vital to understand these concepts as soon as possible. object class method parameter data type © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved. © David J. Barnes and Michael Kölling
17
© 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
18
Objects First with Java
Class Object Here, I start discussing objects and classes. I talk to the students about it for a while, then I do an extensive demo of the shapes example in BlueJ. All important points of this lecture are encountered and pointed out during this demo. All following slides serve only as summary, or reminder. No new material is introduced after the demo. Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling © David J. Barnes and Michael Kölling
19
Classes and Objects A class (abstractions) Objects (concrete)
represents all similar objects of a kind (example: “car”) Objects (concrete) represent ‘things’ from the real world, or from some problem domain; example: “that red car in the parking lot”. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
20
Classes & Objects © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
21
Methods and Parameters
Objects have operations which can be invoked (Java calls them methods). Methods may have parameters to pass additional information needed to execute. Parameters introduce variation into the effect of method calls. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
22
Other observations Many distinct 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). © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
23
State © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
24
Two circle objects © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
25
Source code Each class has source code associated with it that defines its details (attributes and methods). The source code is written to obey the rules of a particular programming language. We will explore this in detail in the next chapter. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
26
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. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
27
Make this Image using Figures Project
© 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
28
Review Classes model concepts. Source code realises those concepts.
Source code defines: What objects can do (methods). What data they store (attributes). Objects come into existence with pre-defined attribute values. The methods determine what objects do with their data. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
29
Review When a method is called an object:
Alters its state, and/or Uses its data to decide what to do. Some methods take parameters that affect their actions. Methods without parameters typically use their state to decide what to do. Some methods return a value. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
30
Review Most programs contain multiple classes.
At runtime, objects interact with each other to realize the overall effect of the program. © 2017 Pearson Education, Inc. Hoboken, NJ. All rights reserved.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.