Hi I am a Novice in c#,
Can any one explain me this ?
{
using System;
//
//
//
DateTime dt = DateTime.Now;
Console.WriteLine("{0}",dt.year);
}
why is it not like
{
DateTime dt = new DateTime(); // Object Inititalization
Console.WriteLine("{0}",dt.year);
}
What is "Now", Is it a class under DateTime.
If it is a class why isnt it intialised as i did ?
If it is a method under DateTime, How can it be assigned to an object of DateTime ?
If it is an attribute under DateTime, How can it be assigned to object of DateTime ?
Please Clarify me over this !!