Jump to content

mlnsharma

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by mlnsharma

  1. Ok, So for a structure,it might be this way in its definition struct DateTime { static (type) Now ; // Field Name-Now // Other members }Now; // Variable of type DateTime Say if i accessed DateTime dt; dt = DateTime.Now; So, is "Now", a static variable of type DateTime ? or a static variable in Structure DateTime ?? If it is a part of struct DateTime, then How can i assign the member of the structure to the structure variable ?? Can u clarify this too??
  2. 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 !!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.