• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Problem With Very Simple While Loop

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic