Which method it is called on 3.ToString()?
- System.Int16.ToString()
- System.Int32.ToString()
- System.Int64.ToString()
Which method it is called on 3.ToString()?
All integer literals in C# default to int
(Int32
) unless they are too big for int
, in which case they become a larger data type that fits, like long
(Int64
).
So in this case, Int32.ToString()
is called.
System.Int32.ToString()
as literal integers are Int32 type