This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes do..while loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "do..while loop" Watch "do..while loop" New topic

do..while loop

prerna boja
Ranch Hand

Joined: Aug 19, 2004
Posts: 67
Hi all,

I have the following program. I have to get the number of question marks,semicolons.... in the ouput. I am getting the output wrong. Please help me....

Shell1.dat : There are lots of symbols in this file: ..;;??
.,.,.,?::: .

I have to get only 3 question marks but I am getting the ouput as 63.
Jeff Jetton
Ranch Hand

Joined: Mar 29, 2005
Posts: 71
I'll give you a hint:

The ASCII code for a question mark is 63. What line in your code might be printing the numerical representation of a letter by mistake?

- Jeff
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
Perhaps simplifying even further: What line prints?

Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Perhaps you can start by showing us the output you get. It will also help if you describe how it differs from what you expect. Then you can use the suggestions above to track down the cause of this difference.


Java API Documentation
The Java Tutorial
I agree. Here's the link:
subject: do..while loop
It's not a secret anymore!