Does unused import and objects have a performance impact

后端 未结 5 1038
一生所求
一生所求 2020-11-29 04:49

I have a doubt, whether the unused imports and unused objects in Java code create any performance impact?

Suppose an object is initialized and never used, what happen

5条回答
  •  温柔的废话
    2020-11-29 05:42

    Yes it impact a bit on performance, if we are referring unused import statement in our java class. The Java compiler will check for references mentioned into the import statement and at minute level it impact on the performance of the your class.

    Thanks

提交回复
热议问题