void (boolean contextPar) { String contextVar = "var value"; myField += contextPar ? contextVar.length() : this.hashCode(); JComponent contextAnonymous = new JComponent() { private int myContextAnonymousInt; }; }