Small Java Programs

This chapter discusses naming and coding conventions as well as reserved words in Java. When you go through this chapter, you'll get some hands-on experience with writing in Java.

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?