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
How to find methods of a assembly file (not using ILDASM)?
How do I convert a string to an int in c#?
Define delegation in .net?
Can we inherit a private class in c#?
What is difference between dictionary and hashtable in c#?
What are class fields?
Define parsing?
What is the implicit name of the parameter that gets passed into the set method/property of a class?
What is a partial class in c#?
Explain the different ways a method can be overloaded?
Why do I get an error (cs1006) when trying to declare a method without specifying a return type?
Which of these string definitions will prevent escaping on backslashes in c#?
What's the difference between System.String and System..StringBuilder in C#?
What is xml serializer?
Can extension methods access private members?