Packaging
Once you have a folder full of class files you technically have enough to share your code.
You can take that folder, put it on a flash drive, and give it to your friend. They can then run your code, presuming they have Java installed as well.
But for several reasons sharing a folder of "loose" classes is unideal. What you really want is to package those classes up into a single file.
This way you never accidentally forget one of the files and its easier to share.