Difference b/w casting and boxing?
Answers were Sorted based on User's Feedback
Answer / linton lazar
Boxing is converting a value type to a reference type
(Object Type).Casting is converting a reference type to a
reference type or a value type as another value type.
int i = 0;
object o = (object)i; //this is boxing
int i2 = (int)o; //this is unboxing.
long l = (long)i; //this is casting.
| Is This Answer Correct ? | 22 Yes | 0 No |
Answer / anil kumar
Boxing is Converting to a value type to refrence type and
casting mean convert value type to a another value type.
int a;
object o=(object)a;(Boxing)
int a;
long b=a;(casting)
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / kinjal panchal
Boxing:- Boxing is converting value type to Reference type.
for Example:-
int i=0;
object O=(object)i;
Casting:- Casting is converting value type to another value type
for example:-
int i=0;
long l=(long)i;
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / anand gopal makwa munger
Boxing is the term for turning a value type (int, double, float, Guid, etc.) into a reference type (System.Object, System.String, etc.). Doing this boxing operation allocates memory on the heap (which the garbage collector will eventually need to reclaim).
Casting is taking a type (say, System.Object) and treating it as another type (say, System.String).
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sridevipc
casting converts value to reference type
boxing converts reference type to value type.
| Is This Answer Correct ? | 2 Yes | 24 No |
How do you create a permanent cookie?
how we declare interface
How is application management and maintenance improved in asp.net 2.0?
What is the typical session identifier?
When maintaining session through sql server, what is the impact of read and write operation on session objects?
What is the difference between HTTP-Post and HTTP-Get ?
Explain transparent caching with aop?
Which type of state management is provided by Query String in ASP.NET?
0 Answers Sans Pareil IT Services,
Can you clarified A Web service can only be written in .NET or not?
What are the asp.net objects? is it application obects, cache objests etc. or is it state managements, web services etc?
Where is ViewState information stored?
Is asp.net free?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)