An example of inheritance:


    class ExtendableStack is Stack
    {
	public:
	   function push (new_item: ItemType)
		// override "push" 
	   {	if (stack_top_index >= stack_size)
		{  
		   stack_size *= 2;
		   renew (buffer, stack_size);
		} 
		Stack::push(new_item);
	   };
    };



[ Go back to tutorial | Tutorial home page | Transframe home page ]

More examples: