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


Please Help Members By Posting Answers For Below Questions

Explain about Error handling and how this is done

545


What you mean by inner exception in c#?

533


What is the difference between CONST and READONLY?

581


How many bytes is an int c#?

500


Explain states of a thread in c#?

539






What is for loop in c#?

516


How can you achieve run time polymorphism in C#?

551


What is the difference between overriding and overloading in systemverilog?

467


When should we use delegates in c#?

498


What is the difference between const and readonly in c#.net?

509


How do I format in c#?

503


Can arraylist hold primitive types?

549


What is difference between int and int in c#?

463


Can hashtable have duplicate keys in c#?

482


What is the difference between writeline and write in c#?

437