What is the reason of declaring a member of a private inner class public in Java if it still can\'t be accessed outside of containing class? Or can it?
publi
I think you are missing the implementing the Iterator interface part in your sample code. In that case, you can't make the hasNext() method have any other visibility identifier other than public since that would end up reducing its visibility (interface methods have public visibility) and it won't compile.