derived 派生  ,inherit 继承
Using inheritance
sealed class can not be inherited.
abstract method and class:
an abstract method is an empty method that has no implementation.
an abstract class is a class that contain abstract members,also can contain non-abstract members.
Because the purpose of the  an abstract class is to act a base class, it's not possible to instantiate an abstract class directly,nor can an abstract class be sealed.
The abstract method in the base class can be override in the derived class.

Using polymorphism
In the base class you can define a virtual method which you can altered in the derived classes with override.

Using Arrays
methods: sort,clear,clone,getlength,indexof,lenght
foreach statement
use a arrays as a method parameters   public int sum(params int[] list){...}
Index a object
}


Using Collections(System.Collections)
ArrayList,Queue,Stack,HashTable

Queue.Enqueue  adds an object to the end of the queue.
Queue.Dequeue  remove and return the object at the beginning of the queue

Stack.Push  insert an object at the top of the stack 
Stack.Pop   remove and return the object at the top of the stack
Stack.Count  get the number of the objects contained in a stack

Hashtable
something about c#Book techBook = new Book("Inside C#"0735612889);
something about c#
// 
something about c#
public Hashtable bookList;
something about c#
//
something about c#
bookList.Add(0735612889, techBook);
something about c#
//
something about c#
Book b = (Book) bookList[0735612889];
something about c#
// b’s title is "Inside C#"

Using Interfaces
An interface is in some ways like an abstract class.  However, it provides  no implementation totally. The class that inherits the interface must provide the implementation.

相关文章: