Domanda

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?

È stato utile?

Soluzione

(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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top