Which of the following statements is correct about the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class Sample
{
public int func()
{
return 1;
}
public Single func()
{
return 2.4f ;
}
}
class Program
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
int i;
i = s1.func();
Single j;
j = s1.func();
}
}
}1.func() is a valid overloaded function.
2. Overloading works only in case of subroutines and not in case of functions.
3.func() cannot be considered overloaded because: return value cannot be used to distinguish between two overloaded functions.
4. The call to i = s1.func() will assign 1 to i.
Posted Date:-2021-02-24 11:05:30