• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Just a quickie......

 
Janeice DelVecchio
Saloon Keeper
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ummmm..... I can't find anywhere where they do this in my beginning java books so I'm gonna come out and ask.....

Is this acceptable:



.... prolly not, but just checking.

Thanks,
Janeice
 
Henry Wong
author
Marshal
Pie
Posts: 21184
80
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Janeice DelVecchio wrote:
.... prolly not, but just checking.


Not sure what are you asking. Besides the fact that x hasn't been initialized, it looks like a valid loop to me.

Henry
 
Janeice DelVecchio
Saloon Keeper
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so you can (like in C++) use the

x++

instead of the

x = x + 1

??

-Janeice
 
Booshitha Krishnan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can use x++;

Also the code posted by you will not be compiled as x is not initialized.
 
Janeice DelVecchio
Saloon Keeper
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks!

-Janeice
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would have taken 1 minute to simply write the code and test it. Something to think about.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49361
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch ( ), Booshitha Krishnan.

Janeice DelVecchio, please have a look at this FAQ. A "quickie" means something different in this country
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic