c# - Using the generic type 'System.Collections.Generic.List<T>' requires '1' type arguments -


i trying create program create vector, generate 100 random numbers (0 - 99) , ask user input whether want numbers sorted high low or low high.

this code have far trying vector working.

using system; using system.collections.generic; using system.collections.generic.list; //this error comes. using system.linq; using system.text;  namespace system.collections.generic {     class list<t>     {         static void main(string[] args)         {             list<int> vectorlist = new list<int>();             vectorlist.capacity(100);             int = 100;             (int x = 0; x <= 100; x++)             {                 random rand = new random();                 = rand.next(0, 100);                 vectorlist.add(i);                 console.writeline(i);             }         }     } } 

except have no idea how fix issue, appreciated.

it's side issue (boltclock has right), change this:

list<int> vectorlist = new list<int>(); vectorlist.capacity(100); 

to this:

list<int> vectorlist = new list<int>(100); 

also, remove <t> class name.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -