Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    90
    Rep Power
    0

    Default [SOLVED] what does the colon means?

    what is this means
    int x=14,y=6, min,
    min = x>y?y:x;

    i tried find it in my book and no luck.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I could try to be clever and tell you the colon is mainly there to absorb water, a few nutrients, and to form the stool into a shape and consistency proper for defecation, but that would probably not be what you want to hear. ;)

    What you are displaying is the ternary operator, and this is a frequent question. Have a look at this recent link: Shorthand ?

  3. #3
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    i just use a mnemonic for this:
    min = ( IF ) ? ( THEN ) : ( ELSE )
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  4. #4
    Join Date
    Jan 2009
    Posts
    90
    Rep Power
    0

Similar Threads

  1. Question mark colon operator question
    By orchid in forum Advanced Java
    Replies: 9
    Last Post: 12-19-2010, 09:49 AM
  2. what does this error means?
    By tiiim83 in forum New To Java
    Replies: 2
    Last Post: 01-06-2009, 04:17 PM
  3. Does anyone know what these error means?
    By minifish in forum New To Java
    Replies: 2
    Last Post: 11-04-2008, 05:37 AM
  4. Need Help Can anyone explain what this means
    By Clemenza1983 in forum New To Java
    Replies: 6
    Last Post: 02-16-2008, 04:13 AM
  5. May someone explain what these things means in Java
    By quickfingers in forum New To Java
    Replies: 2
    Last Post: 01-26-2008, 06:45 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
  •