Ch. 2 Discussion Head First Java. Big Idea Differene between a class and an object What benefit object-oriented programming gives you. Read “Chair Wars”

Slides:



Advertisements
Similar presentations
Abstract Class, Packages and interface from Chapter 9
Advertisements

Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
SUMMARY: abstract classes and interfaces 1 Make a class abstract so instances of it cannot be created. Make a method abstract so it must be overridden.
Object Oriented Programming in Java. Object Oriented Programming Concepts in Java Object oriented Programming is a paradigm or organizing principle for.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
– Advanced Programming P ROGRAMMING IN Lecture 16 Interfaces.
More about classes and objects Classes in Visual Basic.NET.
Object-Oriented PHP (1)
1 Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 8.1 – 8.5.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
HST 952 Computing for Biomedical Scientists Lecture 2.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 22: Object-Oriented Programming COMP 144 Programming Language Concepts Spring 2002.
Chapter 10 Classes Continued
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Inheritance. © 2004 Pearson Addison-Wesley. All rights reserved 8-2 Inheritance Inheritance is a fundamental object-oriented design technique used to.
Object Oriented Programming
BCS 2143 Introduction to Object Oriented and Software Development.
CONCEPTS OF OBJECT ORIENTED PROGRAMMING. Topics To Be Discussed………………………. Objects Classes Data Abstraction and Encapsulation Inheritance Polymorphism.
Tutorial 5 Superclasses, Subclasses and Inheritance.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
Definition of Object - Oriented Language.. Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions"
Lecture 12 March 16, The Scope of a Variable What if there are two variables with the same name? –A local or block-local variable can have the same.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
8. Inheritance “Is-a” Relationship. Topics Creating Subclasses Overriding Methods Class Hierarchies Abstract Class Inheritance and GUIs The Timer Class.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Inheritance. Inheritance is a fundamental object-oriented design technique used to create and organize reusable classes Chapter 8 focuses on: deriving.
: Maha Sabri Altememe Lecturer : Maha Sabri Altememe Lecture :1 1.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
Chapter 8 Specialization aka Inheritance. 2 Inheritance  Review of class relationships  Uses – One class uses the services of another class, either.
(1) ICS 313: Programming Language Theory Chapter 12: Object Oriented Programming.
Chapter 8 Inheritance. 2  Review of class relationships  Uses – One class uses the services of another class, either by making objects of that class.
Object Oriented Programming
Inheritance CSI 1101 Nour El Kadri. OOP  We have seen that object-oriented programming (OOP) helps organizing and maintaining large software systems.
 Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and.
Interfaces F What is an Interface? F Creating an Interface F Implementing an Interface F What is Marker Interface?
Introduction to OOP CPS235: Introduction.
Inheritance and Subclasses CS 21a. 6/28/2004 Copyright 2004, by the authors of these slides, and Ateneo de Manila University. All rights reserved L16:
Repeating patterns Can you work out the next shape in the pattern?
Next Back MAP MAP F-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All.
Object orientation and Packaging in Java Object Orientation and Packaging Introduction: After completing this chapter, you will be able to identify.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
Testing in OO Environment The reasons for testing is not any different for any of the design and implementation methodologies, including OO methodology.
How many …?. What shape can you see? I can see some _____. Q1 Q1 stars.
Object Oriented Programming in Java Habib Rostami Lecture 2.
Learning Plan 6 Java Programming Intro to Object Oriented Programming.
Chapter 12: Support for Object- Oriented Programming Lecture # 18.
Sections Inheritance and Abstract Classes
Visit for more Learning Resources
Object Oriented Programming
JAVA By Waqas.
CHAPTER 5 GENERAL OOP CONCEPTS.
THE AREA OF A CIRCLE An introduction to approximating the area of a circle.
Types of Programming Languages
Recitation 6.
Assignment #14 “DINOmyte”
Object oriented vs procedural programming
Advanced Java Programming
Inheritance, Superclasses, Subclasses
Object Oriented Programming (OOP) LAB # 9
Shapes.
Object-Oriented Programming
SHAPES By: Ms. Conquest.
An Example of Inheritance
Object-Oriented Programming
Can you work out the next shape in the pattern?
2D Shapes Rectangle Circle Triangle Rectangle. What shape is the door? Rectangle.
Can you work out the next shape in the pattern?
Presentation transcript:

Ch. 2 Discussion Head First Java

Big Idea Differene between a class and an object What benefit object-oriented programming gives you. Read “Chair Wars” – Larry v. Brad – procedural v. object-oriented Application to put a shape on a screen. Differences between procedural programming v. classes – reusable code.

Object Oriented A “Class” for each shape P. 29 – a specification change Larry has to put changes into many lines of code Brad creates a new “class” P. 30 – another new specification – Brad has less work than Larry as he modifies the Amoeba class.

Chair Wars - continued P. 31 – – Rotate method in all of Brad’s shapes – Duplicate Code Final Design – Inheritance – advanced concept – Power behind it all Brad looked at what all four have in common – He pulled out all of the common features and put them into a generic class – shape. – All four shapes “inherit” from the Shape class.

Chair Wars Shape is a “superclass” All four shapes are related and “inherit” the characteristics of the superclass. Square, circle, triangle, amoeba – subclass. Page 32 – Amoeba class can over-ride the methods from Shape. Any changes to Shape impact all the subclasses. The use of “classes” is essential to OOP