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
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 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
    
    5

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
    
    5

You're quite welcome!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32611
    
    4
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how come this doesn't work java?
 
Similar Threads
June Newsletter Puzzle
HELP~~
Loops
Dsplaying the alphabet with a loop?
Can someone tell me why?