if statement

Posted on 2006-05-09
Last Modified: 2010-03-31
what does this mean again: a ? b: c
Question by:komlaaa
    LVL 30

    Accepted Solution

    If a is true then return b else return c
    LVL 30

    Expert Comment

    For example, if you have:

    int i = x > y ? 5 : 4 ;

    If x is greater than y, then 5 will be assigned to 'i', else 4 will be assigned.
    LVL 30

    Expert Comment


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now