Chapter 9 Classes & Objects.

Slides:



Advertisements
Similar presentations
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
Advertisements

Object-Oriented Application Development Using VB.NET 1 Chapter 8 Understanding Inheritance and Interfaces.
Systems development life cycle & development methodologies
Chapter 1 Object-Oriented System Development
Information Hiding Chapter 5: Classes and Objects in Depth.
Basic OOP Concepts and Terms
UML class diagrams (1) UML = Unified Modeling Language We use only class diagrams, not other UML diagrams Purpose: –keep OO concepts separate from implementation.
Object Oriented Concepts. Movement toward Objects Instead of data-oriented or process-oriented Analysis, many firms are now moving to object-oriented.
Chapter 7 - Generalization/Specialization and Inheritance1 Chapter 7 Generalization/Specialization and Inheritance.
Centre for Computer Technology ICT115 Object Oriented Design and Programming Week 2 Intro to Classes Richard Salomon and Umesh Patel Centre for Information.
Chapter 5 - Writing a Problem Domain Class Definition1 Chapter 5 Writing a Problem Domain Class Definition.
An Object-Oriented Approach to Programming Logic and Design
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA Prof. Dr. Paulo Brasko Ferreira Fall 2014.
Chapter 10: Writing Class Definitions Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Chapter 3 and 6– Classes, Objects and Methods Object-Oriented Programming Concepts – Read it from Java TutorialJava Tutorial Definition: A class is a.
Object-Oriented PHP (Chapter 6).
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
Chapter 10: Introduction to Inheritance. Objectives Learn about the concept of inheritance Extend classes Override superclass methods Call constructors.
Chapter 6 Classes & Objects. Learning Java through Alice 2 © Daly and Wrigley Class A class defines a particular kind of object. Each class is a blueprint.
Chapter 12 Object-oriented design for more than one class.
CS-1030 Dr. Mark L. Hornick 1 Basic C++ State the difference between a function/class declaration and a function/class definition. Explain the purpose.
Slide 1 Object-Oriented Analysis and Design Attempts to balance emphasis on data and process Uses Unified Modeling Language (UML) for diagramming Use-case.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Programming Paradigms Different paradigms Procedural paradigm, e.g. Pascal Basic Functional paradigm, e.g. Lisp Declarative paradigm, e.g. Prolog Object-Oriented.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
5.1 Basics of defining and using classes A review of class and object definitions A class is a template or blueprint for an object A class defines.
Class Fundamentals BCIS 3680 Enterprise Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Exceptions and Handling
Chapter 11 An introduction to object-oriented design.
SUBCLASSES - JAVA. The Purpose of Subclasses Class Farm String getOwner() void setOwner(String s) int getSize() void setSize(int s) Class DairyFarm String.
1 Inheritance One of the goals of object oriented programming is code reuse. Inheritance is one mechanism for accomplishing code reuse. It allows us to.
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
What is an Object Objects are key to understanding object-oriented technology. An object can be considered a "thing" that can perform a set of related.
Sachin Malhotra Saurabh Choudhary
The Movement To Objects
Advanced Object-Oriented Programming
Interface, Subclass, and Abstract Class Review
Objects as a programming concept
Microsoft Visual Basic 2005: Reloaded Second Edition
Creating Your OwnClasses
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Object Oriented Concepts
Chapter 7 Classes & Objects.
3 Fundamentals of Object-Oriented Programming
Corresponds with Chapter 7
Object-oriented Design in Processing
Chapter 9 Objects and Classes
Lesson Objectives Aims Key Words:
OBJECT-ORIENTED PROGRAMMING
Chapter 7 Classes & Objects.
Object-oriented Design in Processing
Object Orientated Programming
Chapter 5: Classes and Objects in Depth
Outline Anatomy of a Class Encapsulation Anatomy of a Method
CIS16 Application Development and Programming using Visual Basic.net
Chapter 7 Classes & Objects.
Basic OOP Concepts and Terms
Chapter 5: Classes and Objects in Depth
Object-oriented Design in Processing
Classes and Objects CGS3416 Spring 2019.
Object-oriented Design in Processing
Object Oriented Programming(OOP)
C++ Object Oriented 1.
Chapter 20 Object-Oriented Concepts and Principles
Presentation transcript:

Chapter 9 Classes & Objects

Objectives Explain encapsulation. Explain the purpose of inheritance. Explain the purpose of overriding and overloading. Create and explain the use of constructors. Use setter and getter methods. Create a basic UML diagram. Create a program that inherits properties from another program.

Class A class defines a particular kind of object. Each class is a blueprint that tells Alice exactly how to create and display an object. Classes begin with a capital letter.

Objects When an object is created and displayed, we call this instantiating the class because an object is an instance of that class. Object names begin with a lowercase letter.

Object-Oriented Programming Concepts Encapsulation - lets you create a class template for creating objects. It is the process of hiding the attributes of a class and making them accessible via the object’s methods. Inheritance - enables you to create a class that is similar to a previously defined class, but one that still has some of its own properties.  Polymorphism – allows you to create new objects that perform the same methods as the base object but which perform one or more of these functions in a different way.  Overloading Overriding

Declaring Objects Cow cow1 = new Cow ( ……..); Adult emily = new Adult ( …..); Button clearButton = new Button ( );

Constructor A constructor is a method with the same name as the class (including case sensitivity).   A class can contain several constructors to provide a variety of means for initializing objects of that class.  MyFishy nemo =  new MyFishy( ); public MyFishy( ) { }

Alice Setters and Getters

Unified Modeling Language (UML)

Class Template

Application to Run Class Template