Java.util.*?


#1

How come it is sometimes:

java.util.ArrayList; or java.util.HashMap; but in GeneralizationsD (13/13), where we use both an array and HashMapit, it is java.util.* ?

Thank You!


#2

They do this because if you were to import both ArrayList and HashMap

import java.util.ArrayList;
import java.util.HashMap;

You would just be doing extra work when you could instead import both of them in one line

import java.util.*;

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.