Results 1 to 3 of 3
  1. #1
    theBurgh22 is offline Member
    Join Date
    Nov 2010
    Posts
    17
    Rep Power
    0

    Default C programming to Java

    I can't seem to figure out what this line of C programming would be in Java... any help?
    Java Code:
    min = (200- ) > 0 ? (200- )  : T[i]

  2. #2
    theBurgh22 is offline Member
    Join Date
    Nov 2010
    Posts
    17
    Rep Power
    0

    Default

    sorry, it should be...

    Java Code:
    min = (200- ai) > 0 ? (200- ai)  : T[i]

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,309
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by theBurgh22 View Post
    sorry, it should be...

    Java Code:
    min = (200- ai) > 0 ? (200- ai)  : T[i]
    It's an ordinary ternary operator; it reads: if 200-ai is positive the value of the entire expression is 200-ai, else if is T[ i ]. It's the same in Java.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 27
    Last Post: 06-06-2009, 01:09 AM
  2. Replies: 1
    Last Post: 05-31-2009, 10:57 PM
  3. Replies: 1
    Last Post: 05-31-2009, 06:48 PM
  4. Replies: 1
    Last Post: 05-31-2009, 02:17 PM
  5. Replies: 16
    Last Post: 05-28-2009, 03:41 PM

Posting Permissions

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