Advertisement
bravoit

OOP Sealed Class

Sep 8th, 2013
907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace TestClassOOP
  5. {
  6.     class Program
  7.     {
  8.         sealed  class Tiger
  9.         {
  10.             public void show()
  11.             {
  12.                
  13.                 Console.WriteLine("Sealed class !");
  14.             }
  15.         }
  16.         class Dog:Tiger
  17.         {
  18.             // Error: can't derive from sealed type 'Tiger'
  19.         }
  20.         static void Main(string[] args)
  21.         {
  22.             Tiger tg = new Tiger();
  23.             tg.show();
  24.            
  25.             Console.ReadLine();
  26.            
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement