ちなみにC#はダメ
https://ideone.com/sTHigZ
using System;
class Foo {
public static int bar = 99;
public int baz() {return bar;}
}
public class Test {
public static void Main() {
Foo foo = new Foo();
Console.WriteLine(Foo.bar);
//Console.WriteLine(foo.bar); // error CS0176: Static member `Foo.bar' cannot be accessed with an instance reference, qualify it with a type name instead
Console.WriteLine(foo.baz());
}
}