Java class name same as the nested package name

后端 未结 5 858
悲哀的现实
悲哀的现实 2020-12-19 15:40

In my Java application, I use a third-party library.

However, I found something strange, there are some nested packages, and some classes whose name may be the same

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-19 16:07

    You need to do this:

    com.xx.a.a ma = new com.xx.a.a();
    

    Or import the package:

    import com.xx.a;
    
    a ma = new a();
    

提交回复
热议问题