when i try to print a list of objects in c# it does not print what i want, let me demonstrate.
example:
public class Classname
{
public string hello;
public string world;
}
namespace inloggning
{
class Program
{
static void Main(string[] args)
{
List<object> listOfObjects = new List<object>();
Classname example = new Classname();
example.hello = "hello";
example.world = "world";
listOfObjects.Add(example);
Console.WriteLine(listOfObjects[0]);
}
}
}
when i run this it prints out "inloggning.Classname". Can someone help me understand why and how i can fix it so it prints "hello" and "world".