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!

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.*;

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