Invoke a method in a class
using System;
class MyClass
{
void PrintDateAndTime()
{
DateTime dt = DateTime.Now;
Console.WriteLine("{0}", dt);
}
static void Main()
{
MyClass mc = new MyClass();
mc.PrintDateAndTime();
}
}
Output 25/03/2007 2:14:04 PM
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
|