I noticed that people prefer importing javax.swing.JFrame instead of javax.swing.* , importing java.math.BigInteger instead of java.math.* , etc… Is there any downside of importing the whole package instead of importing specifically or is there any upsides importing specifically?
I noticed that people prefer importing javax.swing.JFrame instead of javax.swing.* , importing java.math.BigInteger instead
Share
Usually single class imports are preferred because they make it easy to figure which class is imported. And with modern IDE it’s very easy. So it’s often considered a good style. There is no difference between package and single class imports.