• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem With Very Simple While Loop

 
Scott Kamen
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Scott and Michael
I do not know the problem too

In this part of programme,it works.
What is it wrong?
 
Scott Kamen
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic