Polymorphism Introduction. Polymorphism  Example in Biology: –Different ‘forms’, same species Adapted and adopted from Deitel (2004), IBM (2004), Liang.

Slides:



Advertisements
Similar presentations
Advanced Programming Lesson Plan Sutrisno Ismiarta Aknuranda
Advertisements

TELE3118 extras For week 1. Course delivery Should have watched week 1 videos by now. Wed: Essence Mon: Extras: Elaboration(!) + Extension(+) Form: submitting.
5/15/2015Assoc. Prof. Stoyan Bonev1 Assoc. Prof. Stoyan Bonev, PhD Computer Science dept. American University in Bulgaria
Programming II - Part 1 – Object Oriented Programming with Java Sebastian Uchitel
Excerpts from Introduction to Java Programming, 4E Author: Y. Daniel Liang (Copyright by Prentice Hall)
Lecturer: Fintan Costello Welcome to Hdip 001 Introduction to Programming.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L13 (Chapter 21) Generics.
Aalborg Media Lab 18-Jun-15 Introduction Introduction to System Design I Fall 2004.
Introduction to Computers and Programming Lecture 10: For Loops Professor: Evan Korth New York University.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L14 (Chapter 21) Generics.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Java Programming Practice.
Higher Education seminar 10 June Will Ethridge President Higher Education and International.
More Multithreaded Programming in Java David Meredith Aalborg University.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Introduction to Java Programming with JBuilder 4
EXPERIENCE WITH TWO OOP LANGUAGES IN ONE COURSE Ana Madevska Bogdanova, FCSE, Skopje, Macedoia.
1 CSCE Programming Languages Introduction and Course Administration Dr. Hyunyoung Lee 410B HR Bright
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Exception Handling. Definition  The term exception is shorthand for the phrase "exceptional event.“  An exception is an event, which occurs during the.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 2 1 Java Inheritance.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Module Overview n Module Title: OO Programming n Module Code: MIT3446 n Module Value: 3.0 n Duration: 15 weeks n Class-Contact Hours: Lecture15 hrs n Lab/Tutor30hrs.
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
Input & Output In Java. Input & Output It is very complicated for a computer to show how information is processed. Although a computer is very good at.
Java Programming Computer Engineering Department JAVA Programming Course Asst. Prof. Dr. Ahmet Sayar Kocaeli University - Fall 2014.
Inheritance The Basics in Java. Definition  A class that is derived from another class is called a subclass (also a derived class, extended class, or.
Abstract Classes and Interfaces The Basics in Java.
FOR LOOP WALK THROUGH public class NestedFor { public static void main(String [] args) { for (int i = 1; i
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction to Computers, Programs,
1. Course Information 2 Course Description 3  This course is the continuation in the Fundamental of Computer Problem Solving (CSC128) Emphasis on solving.
Java 프로그래밍 II 한상철 (Han, Sangchul) 상허연구동 102 호 ( )
Java Inheritance in Java. Inheritance Inheritance is a mechanism in which one object acquires all the properties and behaviors of parent object. The idea.
COME 339 WEEK 1. Example: The Course Class 2 TestCourceRunCourse.
CS001 Introduction to Programming Day 6 Sujana Jyothi
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
 2002 Prentice Hall. All rights reserved. Page 1 Inheritance: Object-Oriented Programming Outline 9.1 Introduction 9.2 Superclasses and Subclasses 9.3.
There are three possible lifetime patterns for Java data. Static Data The data is created when the program begins execution and is retained until the program.
CSC 205 Programming II Lecture 4 Abstract Class. The abstract keyword indicate that a class is not instantiable Defining a type which will be specialized.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
An Introduction to the Java Language App Design Flat Rock Community Schools Introductory Java Programming.
Theory *OOP Charachteristic*
Modern Programming Tools And Techniques-I
Introduction to Programming G50PRO University of Nottingham Unit 9 : Classes and objects Paul Tennent
Chapter 1 Introduction to Computers, Programs, and Java
A Java Program: // Fig. 2.1: Welcome1.java // Text-printing program.
GC101 Introduction to computer and program
Interface.
C Programming Language
Section 9.1 Polar Coordinates
Section 2.4 Circles Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall.
آشنایی با جاوا Introduction to Java
Copyright © 2008 Pearson Prentice Hall Inc.
Copyright © 2008 Pearson Prentice Hall Inc.
Copyright © 2008 Pearson Prentice Hall Inc.
Polymorphism Polymorphism - Greek for “many forms”
Object Oriented Programming (OOP) LAB # 9
Copyright © 2008 Pearson Prentice Hall Inc.
class PrintOnetoTen { public static void main(String args[]) {
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
Bacteria are identified by characteristics such as:. - Shape
CSCE 314: Programming Languages Dr. Dylan Shell
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Multithreaded Programming in Java
Copyright © 2008 Pearson Prentice Hall Inc.
Copyright © 2008 Pearson Prentice Hall Inc.
Algorithm and Programming
Presentation transcript:

Polymorphism Introduction

Polymorphism  Example in Biology: –Different ‘forms’, same species Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia Light-morph jaguar Dark-morph or black or melanistic jaguar

Polymorphism  Example in Biology: –Different ‘forms’ between males and females of the same species Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia

Polymorphism  In Java OOP: –Subclasses of a class can define their own unique behaviors and yet share some of the same functionality of the parent class. Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia

Polymorphism public class CylinderDemo { public static void main(String[] args) { Shape shape; shape = new Shape(); System.out.println("Area of current shape: " + shape.getArea()); shape = null; shape = new Circle(10); System.out.println("Area of current shape: " + shape.getArea()); shape = null; shape = new Cylinder(11, 21); System.out.println(" Area of current shape: " + shape.getArea()); shape = null; } Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia

References  Oracle. The Java Tutorials. [Online].  Oracle. Java SE Tutorial [Online]. tutorial html tutorial html  Oracle. Java SE Downloads [Online].  Harvey M. Deitel and Paul J. Deitel, Java: How to Program, 6th ed.: Prentice Hall,  Ken Arnold, James Gosling, and David Holmes, The Java Programming Language, 4th ed.: Addison Wesley Professional,  Sharon Zakhour, Scott Hommel, Jacob Royal, Isaac Rabinovitch, and Tom Risser, The Java Tutorial Fourth Edition: A Short Course on the Basics, 4th ed.: Addison Wesley Professional,  Y. Daniel Liang, Introduction to Java Programming, 6 th ed.: Pearson Prentice Hall, Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia

References  Wikipedia. Sexual dimorphism. [Online].  Wikipedia. Polymorphism (biology). [Online]. Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia