File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes unreachible code detected Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "unreachible code detected" Watch "unreachible code detected" New topic
Author

unreachible code detected

Branden Bobo
Greenhorn

Joined: Jul 16, 2012
Posts: 14
Can anybody tell me why the compiler tells me unreachible code detected in line: 12

I'm guessing it's detecting the inner loop as an infinite loop, but I can't figure out the logical error?



Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

If I read that for-loop right, then it doesn't have a termination condition. So yes, I suppose the compiler might well observe that and classify it as an infinite loop.
Branden Bobo
Greenhorn

Joined: Jul 16, 2012
Posts: 14
Thanks, I feel stupid, I've been staring at this method for 30min stumped by somethiing I should have know(seen).
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Yup, I too have found that there's nothing like asking somebody else a question when you're suffering from that kind of blindness. That's what the Ranch is here for!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: unreachible code detected
 
Similar Threads
Prime Program
how many project Euler problems have you solved?
counting and primes
Recursion-Prime factors
Need help with Prime number Loop and with boolean statement