- Back to Home »
- C#.NET »
- C#.NET static class
Posted by :
Sudhir Chekuri
Tuesday, 5 January 2016
C#.NET Static class should contain only static methods.
Static methods cannot be called using reference.
We cannot create object for Static class
Static methods cannot be called using reference.
We cannot create object for Static class
Example program for C#.NET Static class
Program
Program
using System;
namespace StaticClass
{
class Program
{
static void Main(string[] args)
{
a.add();
}
}
static class a
{
static public void add()
{
Console.WriteLine("add");
}
}
}