• Post Reply Bookmark Topic Watch Topic
  • New Topic

calculate for e2.count result not understud  RSS feed

 
emeka malachy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi every one though this question may not be interesting but i bored me like hell, I have this program that output this

Hellooo
Hellooo
Hellooo
Hellooo
Hellooo
7

i know how come the four Hellooo but can't firgure out how the 7 code come.
sorry for my poor english and explanation this is the whole code thanks.
 
Liutauras Vilda
Sheriff
Posts: 4923
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I see you tried to use code tags before you posted your code (thanks for that), unfortunately not correctly. You can always check how to UseCodeTags (<- link) properly.
I have corrected them for you.

Welcome to JavaRanch.
 
Liutauras Vilda
Sheriff
Posts: 4923
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
emeka malachy wrote:i know how come the four Hellooo but can't firgure out how the 7 code come.

1. Well, you shown us five "Hellooo" printed.
2. The best approach to solve such a problems is a pencil and piece of paper, so you always can draw a table for yourself (assuming that "count" is 0 at the beginning):
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please always tell us where such questions come from. If it is Head First Java, also please tell us the page number.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!