In an arraylist, I have some integers and some string data types.

I would like to display them on console. I am using the following code and it doesn't work.

ArrayList Simexcurve = new ArrayList();

Simexcurve.Add(8);
Simexcurve.Add("Hello world");
Simexcurve.Add(3.145678);

foreach (int n in Simexcurve)

Console.WriteLine(n.ToString());

I get an error at console.WriteLine saying "specified cast is not valid" when it tries to display "hello workd"

there is some typ casting that I should do since 'n' is declared as an int and "hello world" is a string.

can someone guide me how to display?
thanks
nath