Monday's Programming Question
Each Monday I’m going to post a question for you to answer. It’s a good way to see if you’ve been paying attention whilst reading some of the articles on this site. What I hope it will also do is extend your knowledge and comfort level with Java.
This week it’s a runtime error question. 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. That’s to say, 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?
Try and see if you can find the error by just looking at the code. I’ll post the answer on Sunday.
If you need a hint, take a look at the creating your first java program article.


Comments
So damm easy why don’t you put a real Challenge. I won’t give the obvious Answer but it has to do with “JollyMessage.java” named.
Wrong case in the name of the class… it should be JollyMessage and not Jollymessage.
I suppose that this error, and correct me if I am wrong, should be a Classloader Error.
Some file systems are case sensitive and some are not, maybe this situation arises from some assumption to support both.
That’s exacly the error…. good job
just i got the class loader Exception
Yep, well done everyone.