aspose file tools*
The moose likes Beginning Java and the fly likes Just a quickie...... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Just a quickie......" Watch "Just a quickie......" New topic
Author

Just a quickie......

Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1686
    
  12

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


When you do things right, people won't be sure you've done anything at all.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1686
    
  12

so you can (like in C++) use the

x++

instead of the

x = x + 1

??

-Janeice
Booshitha Krishnan
Greenhorn

Joined: Sep 15, 2009
Posts: 1
Yes you can use x++;

Also the code posted by you will not be compiled as x is not initialized.
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1686
    
  12

thanks!

-Janeice
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
It would have taken 1 minute to simply write the code and test it. Something to think about.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39380
    
  28
And welcome to JavaRanch ( ), Booshitha Krishnan.

Janeice DelVecchio, please have a look at this FAQ. A "quickie" means something different in this country
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Just a quickie......