Home / C# Programming / Interfaces :: Discussion

Discussion :: Interfaces

  1. Which of the following is the correct way to implement the interface given below?

    interface IPerson 
    {    
          String FirstName  
          {      
              get;     
              set;     
         }
      }

     

     

  2. A.
    class Employee : IPerson 
    {   
        private String str;  
        public String FirstName   
        {        
             get      
             {           
                 return str;      
             }       
             set       
             {           
                 str = value; 
             }   
          } 
       }
    B.
     class Employee
     {   
         private String str;   
         public String IPerson.FirstName   
         {         
            get      
            {            
                return str;       
            }       
            set        
            {             
                str = value;   
            }    
        }  
     }
    C.
     class Employee : implements IPerson
     {  
         private String str;   
         public String FirstName   
         {       
              get       
              {           
                 return str;      
              }
              set    
              {          
                 str = value;    
              }   
           } 
        }

     

    D.

    None of the above

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment