Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need the long version for java

    what is the extended version of
    Code:
    { Totals[pos]= Totals[pos] + Cart[pos];
    		if(Cart[pos]>0)
    im a total newb to java and am wondering the long version of the above code.
    thanks,

    Ian

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Huh? What do you mean by long version?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Spookster
    Huh? What do you mean by long version?
    The version that compiles perhaps?

    shmoove

  • #4
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if im not mistaken in java 1.5 you can do this but in the later versions you cant and there is an expanded way to write this, I would like to know the long way to write it so I can grasp the concept a bit better.

    HTH,

    Ian

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Isn't it the long way already? Because the short way is this:
    Code:
    Totals[pos] += Cart[pos];
    if (Cart[pos]>0)
    ...
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •