modulo in java Loop


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: modulo in java Loop

  1. #1
    Join Date
    May 2006
    Posts
    10

    modulo in java Loop

    Hi there,
    just Wondering that how can i using modulo operator to increment a number in a java loop. For example, if I want an integer i starts from 8, and increment by 1 at each time, and it comes back to 8 again when it reached 16, does this make sense?
    Thanks!
    Last edited by Lim; 09-25-2006 at 09:37 AM.

  2. #2
    Join Date
    May 2005
    Location
    Ontario, Canada
    Posts
    173
    i starts from 8, and increment by 1 at each time
    Start with
    i=8
    increment i
    if i>16
    i=8

  3. #3
    Join Date
    May 2006
    Posts
    10
    thanks there, problem solved.

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2006, 04:16 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 07:46 AM
  3. DevX does seem one sideded
    By Rob Abbe in forum Talk to the Editors
    Replies: 44
    Last Post: 01-13-2003, 03:57 PM
  4. learning c# very confusing.
    By Mike Tsakiris in forum .NET
    Replies: 11
    Last Post: 10-04-2002, 06:32 PM
  5. Re: VB vs. Visual Age for Java
    By JJ in forum Enterprise
    Replies: 1
    Last Post: 07-06-2000, 05:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center