public class UtilityClassInAnonymousClass { Object annonymous = new Object() { class Inner { private String string; } }; }