Back to questions
JuniorTheoryCommon
What happens when this program is compiled and run?
public class Main {
public static void main(String[] args) {
System.out.println("Hi");
System.out.Println("Bye");
}
}It does not compile
- Expecting
HiandBye: Java is case-sensitive, soPrintlnis an unknown name, and javac reportscannot find symbol. - Expecting
Hito print first: a compile error stops the whole program, so not even the correct lines before it run.
- How does a compile error differ from an error at run time?
- What does javac report for
system.out.println("Hi");written with a smalls?