Question

I want to store values of different data types in a list and retrieve them as it is, such as:

1. 5
2. True
3. PersonName
4. 0.325

is it possible?

Was it helpful?

Solution

(Assuming C# is the language)

You can use a List<object> to store the values. And while retrieving the values you have to cast those properly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top