Don't writefollowed byIt is eitheron its own without using javac at all (I think, Java11+ only), or it isSince you appear to have compiled the class, you will have to use what it says in line 2 of the last code block.
In source-file mode, the effect is as though the source file is compiled into memory, and the first class found in the source file is executed. Any arguments placed after the name of the source file in the original command line are passed to the compiled class when it is executed.
If the Cartoon class declaration had been at the top instead of at the bottom, it would have run fine. Of course, since you didn't know about source-file mode, then you would have been under the wrong impression that what you did was fine. If you moved the Drawing class to the top of the file and ran the same command, it would have complained about the Drawing class instead.
The best ideas are the crazy ones. If you have a crazy idea and it works, it's really valuable.—Kent Beck