KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I don't want my List to be of fixed type. Rather I want the creation of List to be dependent on the type of variable. This code doesn't work: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections.Generic; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { string something = "Apple"; Type type = something.GetType(); List<type> list = null; Console.ReadKey(); } } } Can anybody tell me what changes I need to make in order to make it work right? I want the creation of list to be dependent on the type of variable something
Tags (comma-separated)
Save Edits
Cancel