Take the 2-minute tour ×
class aClass{
public aClass(){

class Test{
public static void main(String args[]) {

    class aClass{
    public aClass(){

 aClass aclass = new aClass();

The result is "Inner", I don't know why Java allows class name duplication? Which can be very confusing? Is this use popular in reality? Thanks!

share|improve this question
possible duplicate of Java inner class with the same name as other top level class –  Greg Hewgill Oct 17 '12 at 3:18
No one helps me? –  user1525788 Oct 18 '12 at 16:10
add comment


Your Answer



Browse other questions tagged or ask your own question.