C# list type not working

I’ve been studying C# for the past couple of days and my book now tells me to add:" public List listname" but Microsoft Visual Studio and Unity report an error at “List”
I have checked for spelling mistakes and have rewritten it a dozen times. The only explanation I could possibly think would be that something has changed since the book came out (it seems to be made for a much earlier version of Unity). This has been driving me crazy! Thanks in advance.

I have to ask the question, Have you included System.Collections.Generic; in your code? Lists are not included automatically so if you don’t have the line “using System.Collections.Generic;” in your code it won’t be usable. That stumped me for a while. If you have and are using the correct command (public List listName;), then things should be working correctly.

Just had the same problem thanks. Thanks @Rangr!