File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes for loop is not running properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "for loop is not running properly" Watch "for loop is not running properly" New topic

for loop is not running properly

Siddhesh Desai

Joined: Jun 28, 2004
Posts: 9
import java.util.*;
class Array
public static void main(String args[])
throws IOException
//char p;
int array[]=new int[10];
BufferedReader br = new BufferedReader(new InputStreamReader(;
for(int i=0;i<5;i++)



Program compiles but do not access array for given loop conditions
Ben Buchli
Ranch Hand

Joined: Mar 26, 2004
Posts: 83
I think your problem is that you use a class name that already exist in the the java standard library: Array.

I'm not sure on this, but it might be worth a try to rename your class.

hope that helps.

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

why do you think this is not working? what were you expecting to see, and what did you see?

i typed it in, compiled it, and ran it. everything seems fine to me.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: for loop is not running properly
It's not a secret anymore!