A package is a folder that groups related classes together. Without packages, every class sits in one global namespace, and name collisions become inevitable as your project grows.
You declare a package at the top of a file:
package com.myapp.models;
public class User {
// class body
}
To use a class from another package, you write an import statement:
import com.myapp.models.User;
You can also import every class in a package with a wildcard: import com.myapp.models.*;. But wildcard imports make it harder to tell where each class comes from, so most teams prefer explicit imports.