why do we use Overloading, Overriding, Boxing, Unboxing,
and what is the use of these ?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / x
in case of multiple use of codeing we use this methods.to
reuse code in all forms.
overloading ,overriding is used to implement methods of
already writtened method used to fill datagrid,
we do boxing in case of saveing data in user defined
form,and try to get data in client defined form.and try to
utilize boxing for type conversion problam
| Is This Answer Correct ? | 13 Yes | 7 No |
Answer / kumar
overloading: using smae function or operator in different
and various way is called the overloading. this is because
of situation and the use. mainly two types are
1). Function overloading
area pi.r^2;
area l.b;
same function area and hence function overloading
2). Operator overloading
int add;
int float;
| Is This Answer Correct ? | 4 Yes | 5 No |
What is instantiating a class?
difference between keyword internal and protected?
What is executescalar in c#?
Is enum a class c#?
Why do we use interface in c#?
Valuetype/reference type?
what is the difference between int and Int32?
Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio ?
Can we override static class in c#?
What is short in c#?
How to use the sreamReader class to read form a text file?
Why do we parse in c#?
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)