aspose file tools*
The moose likes Beginning Java and the fly likes how come this doesn't work java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how come this doesn Watch "how come this doesn New topic
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: 492

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: 6109
    
    6

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: 6109
    
    6

You're quite welcome!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36474
    
  16
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..!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how come this doesn't work java?
 
Similar Threads
Loops
HELP~~
June Newsletter Puzzle
Can someone tell me why?
Dsplaying the alphabet with a loop?