Object Oriented Programming

Slides:



Advertisements
Similar presentations
PHP functions What are Functions? A function structure:
Advertisements

Introduction to classes Sangeetha Parthasarathy 06/11/2001.
INTERFACES IN JAVA 1.Java Does not support Multiple Inheritance directly. Multiple inheritance can be achieved in java by the use of interfaces. 2.We need.
Lecture 10: Part 1: OO Issues CS 540 George Mason University.
Object Orientation Chapter SixteenModern Programming Languages, 2nd ed.1 Spring 2012.
Object Orientation Chapter SixteenModern Programming Languages, 2nd ed.1.
Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
June 1, 2000 Object Oriented Programming in Java (95-707) Java Language Basics 1 Lecture 3 Object Oriented Programming in Java Language Basics Classes,
Lecture 9 Concepts of Programming Languages
Chapter 10 Classes Continued
CSE 413 Programming Languages & Implementation Hal Perkins Autumn 2012 Ruby: Multiple Inheritance, Interfaces, Mixins 1.
Using Jeroo To Teach Object-Oriented Concepts By Christian Digout.
Chapter 6 Class Inheritance F Superclasses and Subclasses F Keywords: super F Overriding methods F The Object Class F Modifiers: protected, final and abstract.
Chapter 4 Objects and Classes.
OOPs Object oriented programming. Based on ADT principles  Representation of type and operations in a single unit  Available for other units to create.
1 Chapter 10: Data Abstraction and Object Orientation Aaron Bloomfield CS 415 Fall 2005.
Object Oriented Programming: Java Edition By: Samuel Robinson.
Java Objects and Classes. Overview n Creating objects that belong to the classes in the standard Java library n Creating your own classes.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
CSE 341, S. Tanimoto Java brief review - 1 Java Brief Review Java’s strengths Object-oriented terminology Inheritance Interfaces An example with inheritance.
Object-Oriented Programming Chapter Chapter
Inheritance Revisited Other Issues. Multiple Inheritance Also called combination--not permitted in Java, but is used in C++ Also called combination--not.
OOPs Object oriented programming. Abstract data types  Representationof type and operations in a single unit  Available for other units to create variables.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 9 Inheritance and.
ISBN Object-Oriented Programming Chapter Chapter
Chapter 8 Class Inheritance and Interfaces F Superclasses and Subclasses  Keywords: super F Overriding methods  The Object Class  Modifiers: protected,
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Terms and Rules II Professor Evan Korth New York University (All rights reserved)
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
C++ General Characteristics: - Mixed typing system - Constructors and destructors - Elaborate access controls to class entities.
Chapter 12: Support for Object- Oriented Programming Lecture # 18.
CSC 243 – Java Programming, Fall, 2008 Tuesday, September 30, end of week 5, Interfaces, Derived Classes, and Abstract Classes.
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
Introduction to Object-oriented Programming
Abstract classes and interfaces
OOP: Encapsulation &Abstraction
Objects as a programming concept
Multi-Methods in Cecil
Inheritance and Polymorphism
Creational Pattern: Prototype
University of Central Florida COP 3330 Object Oriented Programming
Object Oriented Analysis and Design
Lecture 9 Concepts of Programming Languages
CS240: Advanced Programming Concepts
Chapter 9 Inheritance and Polymorphism
Abstract classes and interfaces
Java Programming Language
Advanced Java Topics Chapter 9
The Procedure Abstraction Part V: Run-time Structures for OOLs
Interfaces.
Advanced Java Programming
More Object-Oriented Programming
Java Inheritance.
Tonga Institute of Higher Education
Object-Oriented Programming
CIS 199 Final Review.
Abstract classes and interfaces
Chapter 8 Class Inheritance and Interfaces
Object Oriented Programming
OOP Aga private institute for computer science 5th grade
Object-Oriented Programming
Lecture 10 Concepts of Programming Languages
Inheritance Lakshmish Ramaswamy.
C++ Object Oriented 1.
SPL – PS3 C++ Classes.
CSG2H3 Object Oriented Programming
Lecture 9 Concepts of Programming Languages
Presentation transcript:

Object Oriented Programming Prototype based vs class based OOP Prototype based OOP - cloning, virtual and copied fields and methods SELF Problems: code is not shared, too dynamic

Class based OOP Classes vs instances Only classes have code Only classes inherit Instances have state variables Variations in instances implemented as values of state variables.

Inheritance Type vs Implementation inheritance Types: roles that an object can have -> INTERFACES Organized as a DAG i.e. multiple inheritance for types is relatively trouble free. Classes: implement code – single inheritance: controls complexity adds security

Accessibility of methods and variables in a class Final Ex: security manager Public,private,protected,default Absolute: public, private Dependent on Packages: default, protected

Class vs instance (Static vs. dynamic) fields/vars and methods Class variables: shared among all instance – visible to all instances Ex: instance counter Ex: security manager – final!

Inheriting Methods Virtual methods – all java instance methods are virtual Extra (hidden) parameter: this search for an absent method or field always starts from the class associated with “this” Ex: Circle extends Point -> hide(), show(), moveTo(x,y) – virtual, uses hide() and show() as defined based on the “this” parameter