import std.stdio; class A { private int j = 1; private { int k = 2; } private: int i = 0; } void main() { A a = new A; writeln(a.i); writeln(a.j); writeln(a.k); } It compiles and output 0 1 2 repectively.