Small Java Programs

7. Syntax Errors


Answer:

    • What is the command that runs the Java compiler?
      • javac
    • What is the command that runs the Java interpreter?
      • java

Syntax Errors

It is likely that you will do something wrong. Here is the sample program with a deliberate error:

public Class Hello
{
  public static void main ( String[] args )
  {
    System.out.println("Hello World!");
  }
}

Question 7:

What is the error?