Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all...

whether int is a value type or reference type?

:confused:

obviously it is value type but...if we does following

line 1 int a =10;
line 2 a.tostring()

line 2 shows that a calls the mathod of its base class (which is object).it means int is a class then how do we call it a value type...???

thanks in advance
if some ons call help please...
Posted

It means that the int is boxed ( turned into an object ) when you call ToString on it.
 
Share this answer
 
This[^] might give you some idea how google works, which is bound to help you in future. The book Inside C# is a good reference to buy, but most C# books will also cover this in detail.
 
Share this answer
 
Dear Grauss..can u give me some elaboration or some link so that i can have a better picture...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900