Does an unused import declaration eat memory, in Java?

后端 未结 5 1720
渐次进展
渐次进展 2020-12-05 17:56

Does an unused import like so - import android.widget.RelativeLayout; eat memory? Just want to know about how much or just is it valuable? Maybe this is stu

5条回答
  •  粉色の甜心
    2020-12-05 18:20

    Unused imports do not have a impact at runtime (because there are no imports in the byte code). However, unused imports will affect the compiler, but not by much.

    In general, importing only what you need will lead to improved maintainability and readability of code.

提交回复
热议问题