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 the difference between paramaterized constructor and copy constructor?
What are the types of attributes in c#?
Which property do we set on a Combo Box to display data on it prior to setting the DataSource ?
Can we declare private class in c#?
Are attributes inherited c#?
Can you inherit from a sealed class?
What is meant by clr?
What is the difference between malloc () and new?
What is private protected in c#?
Explain dataadapter.update method in .net?
What are some of the commonly used commands in sqlcommand?
What is difference between ienumerable and list?
What is meaning of type safety in c#?
can you allow a class to be inherited, but prevent the method from being over-ridden?
What is a delegate in c#?