Object Oriented Programming using Java - Composition

Slides:



Advertisements
Similar presentations
Dale Roberts Introduction to Java - First Program Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
Advertisements

Dale Roberts Object Oriented Programming using Java - Inheritance Overview Dale Roberts, Lecturer Computer Science, IUPUI
Dale Roberts Object Oriented Programming using Java - Inheritance Constructors Dale Roberts, Lecturer Computer Science, IUPUI
Dale Roberts GUI Programming using Java - Mouse Events Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Dale Roberts Object Oriented Programming using Java - Class Constructors Dale Roberts, Lecturer Computer Science, IUPUI Department.
Object Oriented Programming using Java - Polymorphism
Dale Roberts Procedural Programming using Java Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
Dale Roberts Object Oriented Programming using Java - Packages Dale Roberts, Lecturer Computer Science, IUPUI Department.
Dale Roberts Introduction to Java - Access Specifiers Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Dale Roberts Program Control using Java - Boolean Expressions Dale Roberts, Lecturer Computer Science, IUPUI Department of.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Dale Roberts Object Oriented Programming using Java - Enumerations Dale Roberts, Lecturer Computer Science, IUPUI Department.
 2005 Pearson Education, Inc. All rights reserved Classes and Objects: A Deeper Look.
Dale Roberts 1 Classes Constructors & Destructors Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer.
Dale Roberts GUI Programming using Java - Event Handling Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Dale Roberts GUI Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Dale Roberts Program Control using Java - Selection Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Classes: A Deeper Look Part.
Dale Roberts GUI Programming using Java - GUI Components Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Dale Roberts Object Oriented Programming using Java - OOD to OOP: ATM Case Study Dale Roberts, Lecturer Computer Science, IUPUI
CS442: ADVANCED PROGRAMMING USING JAVA Lab 6: Classes and objects Computer Science Department.
Dale Roberts Program Control using Java - Repetition Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
 Pearson Education, Inc. All rights reserved Classes and Objects: A Deeper Look.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 23 November 19, 2009.
Computer Science Department CPS 235 Object Oriented Programming Paradigm Lecturer Aisha Khalid Khan Inheritance.
Dale Roberts Object Oriented Programming using Java - Final and Static Keywords Dale Roberts, Lecturer Computer Science, IUPUI
 2005 Pearson Education, Inc. All rights reserved Classes and Objects: A Deeper Look.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 26 - Java Object-Based Programming Outline 26.1Introduction.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Dale Roberts Ethics Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Array Lists Array Lists Dale.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Dale Roberts Introduction to Java - Input, Program Control and Instantiation Dale Roberts, Lecturer Computer Science, IUPUI
 Pearson Education, Inc. All rights reserved Classes and Objects: A Deeper Look.
Dale Roberts Object Oriented Programming using Java - Getters and Setters Dale Roberts, Lecturer Computer Science, IUPUI
Dale Roberts 1 Operator Overloading Member Functions Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Dale Roberts GUI Programming using Java - Windowing Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
GUI Programming using Java - Event Handling
CompSci 230 S Programming Techniques
GUI Programming using Java - Key Events
Department of Computer and Information Science, School of Science, IUPUI Ethics Dale Roberts, Lecturer Computer Science, IUPUI
Quiz # 02 Design a data type Date to hold date
Functions Examples CSCI 230
Object-Oriented Programming: Inheritance
Abstract Data Types Polynomials CSCI 240
A First C Program (mixing datatypes)
A First C Program (mixing datatypes)
Object Oriented Programming using Java - Class Instance Variables
Variable Declarations, Data types, Expressions
Variable Declarations, Data types, Expressions
Abstract Data Types Sparse Matrices CSCI 240
Classes Access Specifiers
Program Control using Java - Theory
Negative Integer Representation
GUI Programming using Java - Mouse Events
Classes Copy Constructors
Pointers Call-by-Reference CSCI 230
Classes Static Members
Concepts in Object-Oriented Design
Analysis of Algorithms Growth Rates
Standard Template Library
Analysis of Algorithms Big-Omega and Big-Theta
Classes Introduction CSCI 240
Employee Task Management Software
Classes Class Data Members & Initializers
Classes Member Qualifiers
Structures Declarations CSCI 230
UNITS OF TIME QUESTIONS.
Presentation transcript:

Object Oriented Programming using Java - Composition Department of Computer and Information Science, School of Science, IUPUI Object Oriented Programming using Java - Composition Dale Roberts, Lecturer Computer Science, IUPUI E-mail: droberts@cs.iupui.edu

Composition Composition A class can have references to objects of other classes as members Sometimes referred to as a has-a relationship One form of software reuse is composition, in which a class has as members references to objects of other classes.

Outline Date.java (1 of 3)

Outline Validates month value Date.java (2 of 3) Validates day value

Outline Date.java Check if the day is February 29 on a leap year (3 of 3) Check if the day is February 29 on a leap year

Outline Employee.java Employee contains references to two Date objects Implicit calls to hireDate and birthDate’s toString methods

Outline EmployeeTest.java Create an Employee object Display the Employee object

Acknowledgements Deitel, Java How to Program