Ronald Abellano

Ronald Abellano

  • NA
  • 161
  • 36.1k

Why declare interface property as an abstract?

Jul 13 2018 6:18 AM
  1. abstract class Position    
  2.     {    
  3.         public abstract string Title { get; }    
  4.     }    
  5.     
  6.     class Manager : Position    
  7.     {    
  8.         public override string Title    
  9.         {    
  10.             get    
  11.             {    
  12.                 return "Manager";    
  13.             }    
  14.         }    
  15.     }    
  16. static class Factory    
  17.     {    
  18.         public static Position Get(int id)    
  19.         {    
  20.             switch (id)    
  21.             {    
  22.               case n:     
  23.                      return new ....    
  24.             }    
  25.         }    
  26.     }   
Can we not just declare the property not abstract? Why it has be overridden when implemented?
 

Answers (1)