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 Problem With Very Simple While Loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem With Very Simple While Loop" Watch "Problem With Very Simple While Loop" New topic
Author

Problem With Very Simple While Loop

Scott Kamen
Greenhorn

Joined: Apr 01, 2003
Posts: 15
I don't know how I can be having problems with this. The syntax of my loop seems to be correct but it might be something else in a different part of my code that is causing my problem. With the following code:

I have other instantiable classes, abstract class , an interface and methods in my code too. Maybe they are causing a problem that is being reflected in my while loop? I can't believe I'm having so much trouble with a while loop.

Thanks again , and I hope the solution is something that will make me feel like an idiot (at least it will be an easy fix then)
-Scott
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Scott,
Welcome to JavaRanch. What exactly is the problem? Also, why don't you just code while(true) { instead of creating a constant to test?


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
hi Scott and Michael
I do not know the problem too

In this part of programme,it works.
What is it wrong?


Francis Siu
SCJP, MCDBA
Scott Kamen
Greenhorn

Joined: Apr 01, 2003
Posts: 15
Yeah the while (true) would be easier I never thought of that. As I thought the syntax of my loop is good. Is there someway that a problem with one of my other classes , interfaces or methods that I wrote could be causing the problem with this while loop? Also I just tried to replace my while loop with a do while loop and I got the exact same compile error except instead of being at where the "while" was it is where the "do" is. The syntax of both of these loops is correct so there must be something else in my code that causing the program. I checked my brackets and I don't think that I have any stray brackets causing trouble so I really don't know what it is.
thanks again,
-Scott
[ May 03, 2003: Message edited by: Scott Kamen ]
Scott Kamen
Greenhorn

Joined: Apr 01, 2003
Posts: 15
I just found the problem and like I thought I feel very very dumb. I hastily never created a main method in my App class. I'm going to go in the closet and bang my head on the wall now.
-Scott
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem With Very Simple While Loop