What is int
in C#? Is it a keyword, or is it a class derived from system.ValueTypes? If it is a keyword then how do the following lines compile
int i = new int(); // If int is not a class then how does it have a default constructor
Console.WriteLine(i.ToString()); // If int is not a class then how does it have member functions
If int
is a class then why is it not necessary to always initialize it with new
? How does the following line compile?
int i = 8;