CSC/ECE 517 Fall 2011/ch1 1i cl: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Created page with "= Introduction = In [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented languages], method is a subroutine which associates with the instances of the class ...")
 
No edit summary
Line 1: Line 1:
= Introduction =
= Introduction =
In [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented languages], method is a subroutine which associates with the instances of the class to define the specific behavior of this class. In the [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance] of these languages, methods reimplementation is essential because descendant class inherited from the ancestor class in which properties and method have been defined to some extent. With the method reimplementation, coding can be more efficient and simple without rewriting the same code again and agian. However, in different OO languages, the ways of acquiring or allowing method reimplementation are significantly different. In this article, we are going to introduce these differences and provide code for better understanding.
In O-o languages (Object-oriented languages), method is a subroutine that associates with the the class and defines the behaviors performed by the instances of the class. A ancestor class may has its descendant classes which inherit all its methods' interfaces(name,return type,etc). Method reimplementation is required when the decendent class needs to change the behavior of a method which was already implemented by the ancestor class, and it is more efficient to do so other than writing a new method. In different O-o languages, the ways to require or allow a class to reimplement methods are very different. So it is important for us to know how different languages handle the reimplementation and what are the advantages and disadvantages of them.

Revision as of 05:49, 7 September 2011

Introduction

In O-o languages (Object-oriented languages), method is a subroutine that associates with the the class and defines the behaviors performed by the instances of the class. A ancestor class may has its descendant classes which inherit all its methods' interfaces(name,return type,etc). Method reimplementation is required when the decendent class needs to change the behavior of a method which was already implemented by the ancestor class, and it is more efficient to do so other than writing a new method. In different O-o languages, the ways to require or allow a class to reimplement methods are very different. So it is important for us to know how different languages handle the reimplementation and what are the advantages and disadvantages of them.