It is field but it is used as type [closed]

0

I'm trying to generate a list in C # but when I try to use the add method it throws the error "It's a field but it's used as a type" I do not understand what it means. Could you help me? this is my code

 List<Area> areas = new List<Area>();


 Area area1 = new Area("Acuario de Veracruz");
 Area area2 = new Area("Playa Mocambo");
 areas.add(area1);       

 Area area3 = new Area("Acuario Inbursa");
 Area area4 = new Area("Museo Soumaya"); 
    
asked by Missael Armenta 28.09.2016 в 20:37
source

1 answer

2

surely you have defined

areas.add(area1);   

At the class level, outside of a method. Without showing us the code of the class, I can contribute a little more. Greetings

    
answered by 28.09.2016 в 22:07