using System;

class Practice4_2
{
public static void Main(string[] args)
{
DateTime today;
today = DateTime.Now;

if (today.DayOfWeek == DayOfWeek.Sunday)
Console.WriteLine("Eat at Joe's");
}
}


Hi :-)

Conplete and utter n00b here :-)


Learning from a book and they don`t explan very well whats going on here.

It reads to me that DateTime today; is declaring an instance of the DateTime class, then today = DateTime.Now; is initiating it with the value "Now" so ya can do DateTime today = DateTime.Now;

The book tells me that everythings an object but it allso says that int and short ect are data types but then int.Parse(stringVariable); which converts the string numberr into an actual numeric number for maths ect
says is an object, a m8 says and it maked sence that theyre the same.

So, i`m just getting a little confused... am i instsantiating an instance of the DateTime class into an object and then assigning the object the value of "Now"?

Is DateTime today; declaring it and today = DateTime.Now; is initiating (giving it its initaal value) ?

Are the "simple data types" in c# objects? with metods ect?
where are theyre code on my hdd?

Thx alot for any help my brain will thank you massivly :-)