Why is using a wild card with a Java import statement bad?

后端 未结 17 1648
梦谈多话
梦谈多话 2020-11-21 13:07

It is much more convenient and cleaner to use a single statement like

import java.awt.*;

than to import a bunch of individual classes

17条回答
  •  后悔当初
    2020-11-21 13:58

    For the record: When you add an import, you are also indicating your dependencies.

    You could see quickly what are the dependencies of files (excluding classes of the same namespace).

提交回复
热议问题