Object Oriented Programming - Ics4mo

  • Uploaded by: Michael Mohamed
  • 0
  • 0
  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Object Oriented Programming - Ics4mo as PDF for free.

More details

  • Words: 399
  • Pages: 1
3 Classes (2 implementation + interface) # of cylinders, # of wheels -> pass parameters

Object-Oriented Programming Tuesday, March 10, 2009 9:07 AM

3 Important Concepts in OOP: 1. Encapsulation 2. Inheritance 3. Polymorphism What is an Object-Oriented Program? - Consist of a group of co-operating objects, exchanging messages to achieve a common objective. What is an Object? - A software construct that encapsulates data, along with the ability to use or modify that data into a software entity. What is Encapsulation? - Encapsulation is the concept of that an object should totally separate its interface from its implementation. All the data and implementation code for an object should be entirely hidden behind its interface.

-

State of an Object? An object has changed its state when one or more data values stored in the object have been modified. When an object responds to a message, it will usually perform an action, change its state return a value or some combination of the above.

Persistence? - The ability of your car radio to remember your list of favourite stations is often referred to as persistence. An object that has the ability to store and remember values is soften said to have persistence. Class Definition? - A set of plans for an object allows you to mass produce lots of copies of the object. Instance of a Class? - An instance of a class - particular example of a software object. Instantiate a Class? - Produce an instance of a class. Invoking a Method of an Object? Public void playStation (in stationNumber) //causes the specific station identified by the integer to be selected for play //void - doesn't return a value //public - available to outside modifiers. myObRef.playStation(3) invokes this method, asks for station 3.

ICS4M0-A Page 1

Class Radio03 - Interface - Instantiate Combo (composition) - Radio03 has a Combo Class Combo extends Radio03 - Combo is a Radio03 type object - Inherits methods from Radio03

Method Overriding: means you have two or more methods in a super class and or subclass which have the same name, with slightly refined functions; but the same parameters. The version of the polymorphic method called is the one closest to the call location. Polymorphism: Multiple methods with the same name. Method Overloading: 2 or more methods in a class or set of classes which have the same name, but different parameter lists.

Related Documents


More Documents from ""

Jeff Notes 1
November 2019 38
Chemical Equilibrium
December 2019 50
Solubility Product
November 2019 24
Essay Rough
December 2019 25