why can't a static member be reached through an instance name?
- by reinier
say I have:
class Test
{
public static int Hello = 5;
}
This obviously works:
int j = Test.Hello;
But why should this not work?
Test test = new Test();
int j = test.Hello;
The instance could not have a member equally named, so I don't see how this could be ambiguous or unresolvable for a compiler.
Anyone any idea why this is?