Diff b/w casting and boxing
Answers were Sorted based on User's Feedback
Answer / ritesh kumar
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 ? | 29 Yes | 1 No |
Answer / kamlesh sharma
casting is a process to convert data of one type to another
data type
and boxing is the process to convert value type to
reference type
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / hafiz usman majeed
casting is the process of coverting one type of data to
another type of data. it is superclass for all type of type
conversions.whereas boxing is subclass of casting where
value types are converted to reference types
| Is This Answer Correct ? | 12 Yes | 5 No |
casting is convertion of data like integer to string,string
to interger,etc..,
but the boxing simply involves to convert the value types
to reference types.That means assigning the value to the
object.
| Is This Answer Correct ? | 8 Yes | 7 No |
What is c-sharp (c#)?
How to find Percentage, name ,College from a resume or document ? How to export these values to other page in C#?
Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).
Can abstract class have parameterized constructor?
Can a class be protected in c#?
What is difference between ienumerable and iqueryable in c#?
What is extension method in c# and how to use them?
What are extender provider components? Explain how to use an extender provider in the project.
What is string pool in c#?
what are implementation inheritance and interface inheritance?
What is method and function in c#?
What is the difference between an application domain and a process?
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)