IIF in java

Posted on 2005-04-09
Last Modified: 2012-05-05
any function like this:
iif( numberOfPrizes % numberOfParticipants == 1);
to return true or false only...
Question by:ethar1
    LVL 92

    Accepted Solution

    boolean flag = (numberOfPrizes % numberOfParticipants == 1);
    LVL 92

    Expert Comment

    or if want the boolean value to be returned from a method you can use:

    return (numberOfPrizes % numberOfParticipants == 1);

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    759 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

    13 Experts available now in Live!

    Get 1:1 Help Now