Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Object Oriented Programming

Object Oriented Programming

Given at JCrete 07 at the University of Crete.

Video of the talk available in Greek on Vimeo https://vimeo.com/10550416

Markos Charatzas

March 02, 2007
Tweet

More Decks by Markos Charatzas

Other Decks in Technology

Transcript

  1. Knowing Abstract Class Interface Encapsulation Polymorphism • • • •

    Object Class Class relationships Object relationships • • • •
  2. Abstract Class [Why you can’t draw a MusicInstrument] Defines properties

    Defines some methods Defines algorithms • • •
  3. Interface vs Abstract Class Purpose Behaviour vs Functionality Implementation None

    vs Some Inheritance Multiple vs Single • • • • • •
  4. Vector persons = new Vector() for(int i = 0; i

    < persons.size(); i++) persons.get(i); Abstraction vs Implementation
  5. Identifying Polymorphism if(calculation.equals(“sum”)) return (x + y); else if(calculation.equals(“sub”)) return

    (x - y); else if(calculation.equals(“mul”)) return (x * y); else return (x / y);
  6. Identifying Polymorphism Add:Calculation return (x + y); Mul:Calculation return (x

    * y); Sub:Calculation return (x - y); Div:Calculation return (x / y);