T
tshad
I have a class I set up where I can access my private variable directly or
through a property (name or Name).
I thought if it was private, I couldn't access it outside of the project?
using System;
using System.Collections.Generic;
using System.Text;
namespace TestInheritance
{
class Account
{
private double balance;
private double overDraftLimit;
private string name;
public string Name
{
get{return name;}
set { name = value; }
}
static void Main(string[] args)
{
Account a1 = new Account();
a1.Name = "WolfMan";
a1.name = "Franky"; <----- ???? shouldn't this be only
accessable inside class?
Console.Read();
}
}
}
through a property (name or Name).
I thought if it was private, I couldn't access it outside of the project?
using System;
using System.Collections.Generic;
using System.Text;
namespace TestInheritance
{
class Account
{
private double balance;
private double overDraftLimit;
private string name;
public string Name
{
get{return name;}
set { name = value; }
}
static void Main(string[] args)
{
Account a1 = new Account();
a1.Name = "WolfMan";
a1.name = "Franky"; <----- ???? shouldn't this be only
accessable inside class?
Console.Read();
}
}
}