Define base class another cs file
//File: base.cs
using System;
namespace BaseClassNS
{
public class MyBaseClass
{
public void PrintMe()
{
Console.WriteLine("I am MyBaseClass");
}
}
}
//////////////////////////////////////
//MainClass.cs
using System;
using BaseClassNS;
namespace UsesBaseClass
{
class DerivedClass : MyBaseClass
{
}
class MainClass
{
static void Main()
{
DerivedClass mdc = new DerivedClass();
mdc.PrintMe();
}
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
|