2
Answers

what will be d output of the following code segment?

Photo of Anjali Khan

Anjali Khan

7y
187
1
hi frnds
 
wt is the output for the below code ?
 
declare @my_name char(10) = 546875.5 
set @my_name = @my_name + '100'
select @my_name

Answers (2)

0
Photo of Rajesh Singh
NA 1.1k 176.3k 9y
Hi
   Overloading: 
 int Area( int len, int height) // Area of rectangle
Ex: Let suppose you want to calculate area of all geometry like  square, rectangle, square etc.
Here method name is same for all geometry but signatures are different.
 
Overriding:
 Let suppose you want o use same method every where but only method 
definition will be different.
Ex: Result();
Here result is common method which will be implemented by all class with different definitions. 
Result will display different value for different classes. 
 
0
Photo of Vivek Bansod
NA 237 8.7k 9y
Thanks Guys...
This clears a doubt a bit. Please reply in case you have more info on this. 
 
0
Photo of Nishant Mittal
NA 5.8k 354.9k 9y
Best example is ToString method .
 
You can override the same according to your need. 
0
Photo of Rajeesh Menoth
NA 24.7k 629.6k 9y
Hi,
 
Ok, Check this reference :
 
http://csharpindepth.com/Articles/General/Overloading.aspx 
0
Photo of Vivek Bansod
NA 237 8.7k 9y
Thanks Nishant & Rajeesh,
 
I got it conceptually but looking for a strong scenario where we have to use overloading or overriding. Overlaoding is simple for that matter but desparately looking for overriding scenario
0
Photo of Rajeesh Menoth
NA 24.7k 629.6k 9y
Hi,
 
Just check this Reference :
 
http://www.aspdotnet-suresh.com/2013/09/polymorphism-in-c-with-example-types-of-polymorphism.html
 
http://www.aspdotnet-suresh.com/2013/09/polymorphism-in-c-with-example-types-of-polymorphism.html 
0
Photo of Nishant Mittal
NA 5.8k 354.9k 9y
Hi Vivek
 
When you want to provide your defination to the existing method, then you have to use Overriding and when you have to use same functionality with different no. of parameters you have to go for Overloading..