This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes I'm not able to compile the below prog...can you pleas tell me what is the error in using while loop Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "I Watch "I New topic
Author

I'm not able to compile the below prog...can you pleas tell me what is the error in using while loop

chanakya nani
Greenhorn

Joined: Jan 11, 2011
Posts: 29
Stefaan Dutry
Ranch Hand

Joined: Sep 17, 2010
Posts: 32

Hello,

From what i see your while loop is placed directly within a class and not within a method or initializer block, so that's your problem there.

Hope this helps.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19232

I've updated your post to fix the code tags so it's easier to read. It shows that Stefaan is right. You have method declarations inside the while-if, and that's not allowed.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
chanakya nani
Greenhorn

Joined: Jan 11, 2011
Posts: 29
Stefaan Dutry wrote:Hello,

From what i see your while loop is placed directly within a class and not within a method or initializer block, so that's your problem there.

Hope this helps.




Thank you very much that is helpful.
chanakya nani
Greenhorn

Joined: Jan 11, 2011
Posts: 29
Stefaan Dutry wrote:Hello,

From what i see your while loop is placed directly within a class and not within a method or initializer block, so that's your problem there.

Hope this helps.


Thank You very much...It was helpful.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: I'm not able to compile the below prog...can you pleas tell me what is the error in using while loop
 
Similar Threads
HFJ TwoButtons problems
Eclipse and Netbeans
TwoButtons App From "HeadFirst Java" Book
Head First Java Question - GUI program TwoButtons
Beginners question (Head First - TwoButtons)