I have a doubt in the below piece of code. I wanted to know why does the code compile and run correctly even though main method is not present?
import acm.program.*;
public class HelloConsole extends ConsoleProgram {
public void run() {
println("hello, world");
}
}
Thanks.
Because consoleprogram extends the class program which contains a main method.