Java Number Equal areEqual(boolean c1, boolean c2)

Here you can find the source of areEqual(boolean c1, boolean c2)

Description

are Equal

License

Open Source License

Declaration

public static boolean areEqual(boolean c1, boolean c2) 

Method Source Code

//package com.java2s;
/*//from w w  w . j  a v a 2  s.  co m
 * Copyright (c) 2014, 2017 Hewlett-Packard Development Company, L.P. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

public class Main {
    public static boolean areEqual(boolean c1, boolean c2) {
        return c1 == c2;
    }

    public static boolean areEqual(char c1, char c2) {
        return c1 == c2;
    }

    public static boolean areEqual(long c1, long c2) {
        return c1 == c2;
    }

    public static boolean areEqual(float c1, float c2) {
        return Float.floatToIntBits(c1) == Float.floatToIntBits(c2);
    }

    public static boolean areEqual(double c1, double c2) {
        return Double.doubleToLongBits(c1) == Double.doubleToLongBits(c2);
    }

    public static boolean areEqual(Object c1, Object c2) {
        return c1 == null ? c2 == null : c1.equals(c2);
    }
}

Related

  1. areEqual(boolean aThis, boolean aThat)
  2. areEqual(boolean aThis, boolean aThat)
  3. areEqual(boolean aThis, boolean aThat)
  4. areEqual(double d1, double d2)
  5. areEqual(double one, double two)
  6. areEqual(final boolean aThis, final boolean aThat)
  7. areEqual(final char aThis, final char aThat)