2015年3月16日星期一

Object-Oriented Programming Concepts

Object:
It is a program related state and behaviour.

Class:
A class is a blueprint or prototype from which objects are created. So it is a main program that tells what this whole program works and wants to show. It intentionally focuses on the basics, showing how even a simple class can cleanly model state and behaviour.

inheritance:
It provides a powerful and natural mechanism for organizing and structuring software. Class "inherit" and extend from superclass-- main class. And this is how we create subclass.

interface:
When a class implements an interface, it provides the behaviour published by that interface.

package:
It is a namespace for organizing classes and interfaces in a logic manner which will make the program easier.

abstract data type

The abstract data type is a new thing we learnt this week. It is  a mathematical model for a certain class of data structures that have similar behaviour. The stack is a specific thing we are getting to. There are three basic functions we are using usually, push, top, pop.