public static boolean isSameYearMonth ( YearMonth first , YearMonth second ) { // If both values are null, return true. if ( first == null && second == null ) { return true ; } // At least one value contains a YearMonth. If the other value is null, then return false. if ( first == null || second == null ) { return false ; } // Both values contain a YearMonth. // Return true if the YearMonth are equal, otherwise return false. return first . equals ( second ) ; }
isSameYearMonth This compares two YearMonth variables to see if their values are equal . Returns true if the values are equal otherwise returns false .