6
import java.io.*;
class Myclass
{
 //Some programming code that does not call any java io package methods or variables
}

Is that program takes more memory or even worse affect performance of the software/app than the program that has no unused imports?

4
  • 2
    No. They just may the compiler work harder! With or without the unused import has no effect on the produced class file, which then has no effect on the runtime performance. Commented Jun 15, 2015 at 13:45
  • See also here. Commented Jun 15, 2015 at 13:47
  • Does that means it effects performance?Please elaborate. Commented Jun 15, 2015 at 13:49
  • Also duplicate of this: stackoverflow.com/questions/18153690/… Commented Jun 15, 2015 at 14:38

1 Answer 1

3

No, imports are a compile-time feature (they have no meaning in the compiled code). They do not affect runtime behavior.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.