| Author |
how come this doesn't work java?
|
saurabh pant
Greenhorn
Joined: Apr 16, 2012
Posts: 4
|
|
|
|
 |
Hunter McMillen
Ranch Hand
Joined: Mar 13, 2009
Posts: 490
|
|
What specifically are you having trouble with? Are you getting incorrect output? Do you get compile or runtime errors? You need to give more information about your problem.
Hunter
|
"If the facts don't fit the theory, get new facts" --Albert Einstein
|
 |
saurabh pant
Greenhorn
Joined: Apr 16, 2012
Posts: 4
|
|
When I give input:3
I get,
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
at pack1.cube.main(cube.java:94)
Java Result: 1
I dry run it.i dont know where the problem resides..!!
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 5809
|
|
saurabh pant wrote:When I give input:3
I get,
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
at pack1.cube.main(cube.java:94)
Java Result: 1
I dry run it.i dont know where the problem resides..!!
The error message is telling you exactly what's wrong. It's telling you that on line 94 of cube.java, you're trying to access the 4th element (at index 3) of an array that has fewer than 4 elements.
|
 |
saurabh pant
Greenhorn
Joined: Apr 16, 2012
Posts: 4
|
|
I pinpointed d flaw...thanks a lot..!
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 5809
|
|
You're quite welcome!
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
Welcome to the Ranch Please avoid abbreviations like “d”.
|
 |
saurabh pant
Greenhorn
Joined: Apr 16, 2012
Posts: 4
|
|
I will keep that in mind...Thanks for the site...a great support...indeed..!
|
 |
 |
|
|
subject: how come this doesn't work java?
|
|
|