1. Home
  2. Computing & Technology
  3. Java

Common Runtime Error

By , About.com Guide

Common Runtime Error Question

Level: Beginner

Focus: Basic concepts, runtime errors

Here’s a piece of code that has been saved in a file called "JollyMessage.java":

// A jolly message is written to the screen!
class Jollymessage
{

   public static void main(String[] args) {

     //Write the message to the terminal window
     System.out.println("Ho Ho Ho!");

   }
}

The above code will produce a runtime error message. To put it another way, a mistake has been made but it won’t be picked up when the program is compiled, only when it is run. What is the mistake and what error will be returned when the compiled code is executed?

To get the most out of this question try and figure out the answer before coming back to read the solution on the next page.

Explore Java
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Java
  4. Programming Exercises
  5. Beginner Level
  6. Common Runtime Error>

©2010 About.com, a part of The New York Times Company.

All rights reserved.