Re: ArrayIndexOutOfBoundsException
On 2/25/2010 10:04 AM, rossum wrote:
On Thu, 25 Feb 2010 05:07:02 -0800 (PST), dendeezen
<tsd35328@scarlet.be> wrote:
Hi,
With the following code I get an ArrayIndexOutOfBoundException, and I
can't figer out why.
(This is a really newby question, I know)
Eric's answer should have been sufficient, there is a great deal of
information contained in the information Java gives you after it
detects an error. That information should have been sifficient for
you to determine the cause of your error.
Exactly. But he wanted to know "why" -- and since the
proximate cause was so blindingly obvious (and even if it
weren't, Java helpfully pointed it out to him), I couldn't
imagine what sort of a "why" he wanted.
In "The Cuckoo's Egg," Clifford Stoll tells of facing
a panel of professors at his thesis orals. They grilled
him in turn, and when it came time for the last professor's
question, he asked Stoll "Why is the sky blue?" Stoll almost
fainted with relief at getting such a simple question, and
said something about scattering angles and wave lengths. The
professor asked for more detail. Stoll gave more detail, and
the professor asked for more yet. Within a fairly brief time,
Stoll was sweating bullets and covering the blackboard with
partial differential equations that he hoped he remembered
correctly ...
"Why" can be a simple question, or can be a deep one.
Since the O.P.'s simple answer had already been handed to
him by Java, I couldn't tell what deeper meaning he had in
mind. But in view of his politeness, I don't care any more.
--
Eric Sosman
esosman@ieee-dot-org.invalid