ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Dot Net  >>  Dot Net General
 
 


 

 
 Dot Net Framework interview questions  Dot Net Framework Interview Questions
 Dot Net Remoting interview questions  Dot Net Remoting Interview Questions
 Dot Net WindowsForms interview questions  Dot Net WindowsForms Interview Questions
 Dot Net General interview questions  Dot Net General Interview Questions
 Dot Net AllOther interview questions  Dot Net AllOther Interview Questions
Question
i have 2 functions, int add(int a,int b); 
double add(int a,int b); does this code implement 
overloading? if not what will be the error?
 Question Submitted By :: Suren
I also faced this Question!!     Rank Answer Posted By  
 
  Re: i have 2 functions, int add(int a,int b); double add(int a,int b); does this code implement overloading? if not what will be the error?
Answer
# 1
That will throw an error coz in the second function the 
return type is double and result will be in double. to 
rectify it we need to convert the second function result as 
double, then the code executes correctly.
 
Is This Answer Correct ?    0 Yes 3 No
Suren
 
  Re: i have 2 functions, int add(int a,int b); double add(int a,int b); does this code implement overloading? if not what will be the error?
Answer
# 2
it will throw an error because the function overloading is 
acheived by
1) changing the number of parameters
2) changing the order of parameters of different datatypes

we can't acheive function overloading by changing the 
return type
 
Is This Answer Correct ?    10 Yes 0 No
Dhakir Hussain
 
 
 
  Re: i have 2 functions, int add(int a,int b); double add(int a,int b); does this code implement overloading? if not what will be the error?
Answer
# 3
it will throw compile error because of same parameter's 
data type in second overloaded function.
 
Is This Answer Correct ?    1 Yes 0 No
Manoj Gharat
 
  Re: i have 2 functions, int add(int a,int b); double add(int a,int b); does this code implement overloading? if not what will be the error?
Answer
# 4
C#: CIL supports overloading by return type

C# and most other languages that allow method overloading do
not allow overloading by return type. What this means is
that methods can be overloading only if they differ by
parameters. So the following code will not compile as the
methods differ only by return type

class Employee

{

//...

}

class Program

{

static int Func(Employee emp) {

return emp.Id;

}

static string Func(Employee emp) {

return emp.Name;

}

}
 
Is This Answer Correct ?    0 Yes 3 No
Ar Prabhakaran
 

 
 
 
Other Dot Net General Interview Questions
 
  Question Asked @ Answers
 
what is a strong name?  3
what is viewstate?  1
Is .net is platform independent. If am using solaris, installing .net first u had to install framework, so framework is .exe file then it will not take in solaris or any other than windows,then how .net is platform independent.  1
What are Satellite Assemblies? How you will create this? How will you get the different language strings?  3
Write an StoredProcedure to get the values of a column within a date range. Deloitte1
Resource Files: How to use the resource files, how to know which language to use?  1
1.What is the major advantage of polymorphism? Please don't simply say binding. Specify any other reason. 247Customer1
How do you start, pause, continue or stop a Windows service off the command line?  1
What are the features of UIP Application Block?  1
What is the difference between Server.Transfer and Response.Redirect?  3
What is an Interface? Have you ever developed an Interface. Deloitte5
How ASP .NET different from ASP?  4
what is the use of stored procedure which has only one select statement over simple select statment query ? Why to write a stored procedure then ?  3
What are Generics? Where do we use them. Value-Labs2
How do you handle Start, Pause, Continue and Stop calls from SCM within your application?  1
Give An example of a ctype and directcast. Wipro2
I am looking for a fast track course (MAX 15 days) in MS.NET 3.5 and SQLSERVER 2005 in hyderabad or mumbai or pune. I am working in mumbai so cannot gor for long course. Can any body suggest me the best couching class or best faculty for the same. Thanks.  2
What are the two kinds of properties. Wipro2
What are object pooling and connection pooling and difference? TCS3
What is RCW (Run time Callable Wrappers)?  1
 
For more Dot Net General Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com