So in the my first java file I have these imports:
import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.InputStreamReader; import java.net.URL; import java.util.regex.Matcher; import java.util.regex.Pattern;
and in my second i have these:
import java.io.BufferedWriter; import java.io.FileWriter; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern;
The reason I have done it like this instead of doing
import java.io.*; import java.util.*; import java.util.regex.*;
Is because I figured that it was more efficient to import only the exact things you are using instead of importing all the classes and only using a couple of them. Is this the best way to do it or am I just making my code look a bit long winded and sloppy?
Appreciate all of your opinions

New Topic/Question
Reply



MultiQuote





|