Importing and expanding are two different things.
Import
Classes are organized into packages that provide a namespace that avoids name conflicts. Import allows you to use a class in your code without namespace information.
Import is optional. You never need to import anything if you always use the fully qualified class name, but this makes it difficult to read your code.
If you want to create a list of objects Calendar, for example, you or import java.util.List, java.util.ArrayListand java.util.Calendarand use:
List<Calendar> array = new ArrayList<>();
Or import nothing and use:
java.util.List<java.util.Calendar> array = new java.util.ArrayList<>();
. , , . . :
List<java.awt.List> array;
Java, , . , extends. Bus extends Vehicle, , Bus Vehicle. , , . , :
public park(Vehicle v) {
v.drive();
v.turn(Direction.LEFT);
v.stop();
}
Bus , Bus Vehicle.
parkingLot.park(new Bus());
drive(), turn() stop() Bus. .
, . , , , ( , ). A Car Motor, , turnOn(), drive().
Java .