G
Guest
I am new to OO programming and learning C#. I am trying to print out the
contents of an object, but am only seeing the reference to the object. The
accounts array contains Account objects, which consist of an Id, Owner and
Balance. My code is printing out
Account Name: ass1.Account
instead of
Account Name: John Smith
// List the accounts in the account array
public void ListAccounts()
{
for (int i=0; i < 100; i++){
Console.WriteLine("Account Name: {0}", accounts);
}
How do I get the actual values from the object rather than the reference?
Alison
contents of an object, but am only seeing the reference to the object. The
accounts array contains Account objects, which consist of an Id, Owner and
Balance. My code is printing out
Account Name: ass1.Account
instead of
Account Name: John Smith
// List the accounts in the account array
public void ListAccounts()
{
for (int i=0; i < 100; i++){
Console.WriteLine("Account Name: {0}", accounts);
}
How do I get the actual values from the object rather than the reference?
Alison