Yes there is.
In fact, you are not returning a direct link to your private class, as other classes cannot use it. Instead, you extend some public class and return your private class as an instance of this public class. Then you can call any methods that he inherited.
public interface Printable { void print(); } public class Test { public Printable getPrintable() { return new PrintTest(); } private class PrintTest implements Printable { public void print() { } } } Test test = new Test(); test.getPrintable().print();
source share