Lockable Interface

I created a coin program that has a setKey, unlock, locked, and lock methods. I got the program to compile. However, I was wondering if it is supposed to run. When I run the program I receive exception in main thread error.
[230 byte] By [azuldiablo07a] at [2007-11-27 1:01:37]
# 1

How could we know what it'ssupposed to do and what's going wrong without seeing your exact code and the exact, complete error message? "Exception in main thread" is only part of the error message and really only tells you that *something* went wrong. There will be a whole bunch more stuff that will tell you exactly what and exactly where.

When you post code, please use[code] and [/code] tags as described in [url=http://forum.java.sun.com/help.jspa?sec=formatting]Formatting tips[/url] on the message entry page. It makes it much easier to read.

jverda at 2007-7-11 23:36:32 > top of Java-index,Java Essentials,Java Programming...
# 2

> I created a coin program that has a setKey, unlock,

> locked, and lock methods. I got the program to

> compile. However, I was wondering if it is supposed

> to run. When I run the program I receive exception in

> main thread error.

No, just because a program compiles there still may be programming errors in it. Some errors can only be detected when the program runs.

jverda at 2007-7-11 23:36:32 > top of Java-index,Java Essentials,Java Programming...