You would compile the old, uncorrected version of the source file on hard disk and get the same error message.
When you use a text editor you change
the source program that is in main memory.
If you don't save your changes, the file on disk does not change.
The compiler javac
uses the
file that is currently on the hard disk.
This is a common mistake.
Until your program runs correctly:
javac
command.java
command.This is called the "edit-compile-and-run" cycle. Expect to go through it many times per program. A Java development environment like Eclipse or BlueJ is more sophisticated, but you still go through the same fundamental cycle.
If a source program compiles correctly in step 3, does that mean that it will run correctly?