Home / C# Programming / Inheritance :: Discussion

Discussion :: Inheritance

  1. Which statement will you add in the function fun() of class B, if it is to produce the output "Welcome to FresherGate.com!"?

       namespace FresherGateConsoleApplication
       {  
          class A  
          {      
              public void fun()  
              {           
                 Console.Write("Welcome");     
              }      
          }    
          class B: A     
          {      
              public void fun()      
              {          
                  // [*** Add statement here ***]             
                  Console.WriteLine(" to FresherGate.com!");           
               } 
           }  
           class MyProgram 
           {      
               static void Main (string[ ] args)     
               {            
                  B b = new B();        
                  b.fun();       
               }  
            } 
         }
    

     

  2. A.

    base.fun();

    B.

    A::fun();

    C.

    fun();

    D.

    mybase.fun();

    E.

    A.fun();

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment