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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "unreachible code detected" Watch "unreachible code detected" New topic
Author

unreachible code detected

Branden Bobo
Greenhorn

Joined: Jul 16, 2012
Posts: 15
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: 18987
    
    8

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: 15
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: 18987
    
    8

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://aspose.com/file-tools
 
subject: unreachible code detected