why do we use Overloading, Overriding, Boxing, Unboxing,
and what is the use of these ?
Answer Posted / vijay rana
overloding:- if we want to use a function which have
different behaviour in different situation means for
different signature it behaves differently it is called
function overloding
overriding:- if we want a function which have the same
behaviour in the supercalss as well as in the subclass also
and in the case of overriding method signature and return
type should be same , it is called method overriding
boxing:
if we want to convert a value type value in an object it
is called boxing
for example
int m=10;
object om=10;
it does not require any explicitly conversion
unboxing:-unboxing means when we want to convert a object
type to a value type , it is called unboxing
int m=10
object om=m;
byte n=(byte)om;
| Is This Answer Correct ? | 30 Yes | 6 No |
Post New Answer View All Answers
What is yield keyword?
Why to use lock statement in c#?
What is the difference between var and dynamic types in c# 4.0?
What is the main usage of keyword “virtual†? How does it work for a method or property?
What is the difference between dictionary and hashtable in c#?
What Happens In Memory When You Box And Unbox A Value-type?
Which class does the remote object has to inherit?
Is c# code is managed or unmanaged code?
What are the Types of compatabilities and explain them
Can you specify nested classes as partial classes?
What is view model in c#?
What is expression tree with example?
What are the different types of constructors in c#?
How do I format in c#?
Can abstract class be sealed in c#?