Skip to content
Loading
  • Sachin Singh
    0
    what do you mean by calling a function with property?
    property are attributes of an entity that can be set inside constructor or method.
    1. public class Car  
    2. {  
    3. private int _modelNumber;  
    4. public string Name {get;set;} // autoimplement short version  
    5. public int modelNumber  
    6. {  
    7. get  
    8. {  
    9. return _modelNumber;  
    10. }  
    11. set  
    12. {  
    13. _modelNumber=value;  
    14. }  
    15. public Car(int MN)  
    16. {  
    17. _modelNumber=MN;  
    18. }  
    19. }  
    20.    
    21. Public List GetCars()  
    22. {  
    23. List cars= new List{new Car(1002){name="Maruti"},new Car(1003){Name="BMW"}}  
    24. return cars;  
    25. }  
    0
  • 0
    class a
    {
         private string [,,,] ac()
         {...function body...}
         public string [,,,]h=> ac().clone();
    }
    class b
    {
        void cmd_click(........)
        {
              a aa=new a() 
             string [,,,] cl= aa.h;
             msgbox(cl[0,0,0,0]);    // this gives unexpected result maybe nothing 
                                                // if you use a variable instead of function it will provide expected result ....
         } 
     
    } 
    0