
Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Anno domini Fri, 25 Jun 2004 22:06:44 GMT, Roedy Green, nobilissimus apud
internautas, scripsit:
> http://mindprod.com/jgloss/sleep.html
Actually that's what I did, but I'm getting an error and I cannot see the
reason...
Writing
Thread.sleep(1000);
will result in the error I reported and be underlined in red in JBuilder,
so something's wrong, and that's what I'm puzzled about!
Poochie©
Poochie - 25 Jun 2004 23:30 GMT
Anno domini Fri, 25 Jun 2004 22:25:47 GMT, Poochie, nobilissimus apud
internautas, scripsit:
[CUT]
Now I got it working, the problem was that I simply had no idea that a
method could refuse to work because I set no CATCH, at most I thought it
could give an exception...
Chris Smith - 26 Jun 2004 00:08 GMT
> Now I got it working, the problem was that I simply had no idea that a
> method could refuse to work because I set no CATCH, at most I thought it
> could give an exception...
Well, sort of. It can just give an exception, but Java requires that
you acknowledge the possibility of an exception arising from any
dangerous action. InterruptedException is one of the places where it
makes the least possible sense, though, since it represents a
programming bug for a thread to be interrupted when it wasn't expected.
Nevertheless, InterruptedException was classified as a checked
exception, so you have to abide by the rules.
You don't have to catch the exception, though. Your other alternative
is to declare it in a throws clause in the method declaration, to
indicate you don't intend to handle the exception here and it should be
passed on.

Signature
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Roedy Green - 25 Jun 2004 23:41 GMT
>> http://mindprod.com/jgloss/sleep.html
>
>Actually that's what I did, but I'm getting an error and I cannot see the
>reason...
Read the entry again. It has mutated, like the Borg, adapting to your
new assaults on Java.

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.