0

which one performs faster?

import java.util.Stack;
import java.util.HashSet;
import javafx.scene.Scene.shape;

or this:

import java.util.*;
import java.scene.Scene.*;

The former makes the source file bigger. Does it affect the performance as well?

Dylan Czenski
  • 1,305
  • 4
  • 29
  • 49
  • *"Does it affect the performance as well?"* How could it? – Tom Apr 14 '17 at 04:09
  • It affects _my_ performance. If I'm reading a Java class and it refers to some other class, and I can't find that class in the imports because the imports use wildcards, then I have to play hide-and-seek to figure out what package the class is in so that I can find the Javadoc. (OK, if I'm using a decent IDE it could find that for me. But I don't always.) – ajb Apr 14 '17 at 05:31

1 Answers1

0

If you want to follow some programming standard then do import specific e.g import java.util.Stack; We use sonarcube server which shows you potential exception that can occur as well programming standard that has been not maintained. It shows some time unused package import means you have imported some classes but you have not used it . So basically what you want to use import it & not other things.

Rahul Rabhadiya
  • 430
  • 5
  • 19