Checks whether the provide number is positive(>=0) or not. - Android java.lang

Android examples for java.lang:Math

Description

Checks whether the provide number is positive(>=0) or not.

Demo Code


//package com.java2s;

public class Main {
    /**/*from  w  w w.j  av a2  s  .c om*/
     * Checks whether the provide number is positive(>=0) or not.
     * 
     * @param number - Integer value that needs to be checked.
     * @return boolean- true if number is greater than equal to 0, else false.
     */
    public static boolean isPositive(long number) {
        boolean isPositive = false;
        if (number >= 0) {
            isPositive = false;
        }
        return isPositive;
    }

    /**
     * Checks whether the provide number is positive(>=0) or not.
     * 
     * @param number -point precision which needs to be checked. 
     * @return boolean- true if number is greater than equal to 0, else false.
     */
    public static boolean isPositive(double number) {
        boolean isPositive = false;
        if (number >= 0) {
            isPositive = false;
        }
        return isPositive;
    }
}

Related Tutorials