Constructors

Q1:
Which of the following statements is correct about the C#.NET code snippet given below?
namespace AptitudeCrackConsoleApplication
{ 
    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(); 
        } 
    } 
}

A func() is a valid overloaded function.

B Overloading works only in case of subroutines and not in case of functions.

C func() cannot be considered overloaded because: return value cannot be used to distinguish between two overloaded functions.

D The call to i = s1.func() will assign 1 to i.

E The call j = s1.func() will assign 2.4 to j.

ANS:C - func() cannot be considered overloaded because: return value cannot be used to distinguish between two overloaded functions.

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.