Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Incrementation

Reply
Thread Tools

Incrementation

 
 
Max
Guest
Posts: n/a
 
      03-23-2007
Is there a way to increment by more than one in Java? I know it can be
done in C (as I read a book about it, haven't actually used it), but I
can't find anything about it in Java.

 
Reply With Quote
 
 
 
 
Max
Guest
Posts: n/a
 
      03-23-2007
Never mind, I figured it out.

If you find this thread years later thinking that it'll have an
answer, try i += n, where i is what is incrementing and n is the
amound. Decrement is similar, use -=

 
Reply With Quote
 
 
 
 
Lars Enderin
Guest
Posts: n/a
 
      03-23-2007
Max skrev:
> Is there a way to increment by more than one in Java? I know it can be
> done in C (as I read a book about it, haven't actually used it), but I
> can't find anything about it in Java.
>

Like in C: Use +=

foo = foo + anything;
is equivalent to
foo += anything;

int foo = 17;
foo += 99;
 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      03-23-2007
On Mar 23, 11:26 am, Lars Enderin <(E-Mail Removed)> wrote:

An explaination that makes more sense than mine. Ignore my
explaination. It doesn't exist.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with the incrementation of pointer HansWernerMarschke@web.de C Programming 4 04-26-2008 10:15 AM
About simple confusion of array incrementation sam C++ 4 06-26-2007 04:54 PM
Confusing incrementation Petterson Mikael XML 0 09-06-2006 11:40 AM
Variable name incrementation everett C++ 3 02-13-2004 07:12 PM
Re: Nested For Loop incrementation Ralf Hildebrandt VHDL 3 07-03-2003 12:28 AM



Advertisments