Java - Write code to check if two string are equal

Requirements

Write code to check if two string are equal

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String str1 = "book2s.com";
        String str2 = "book2s.com";
        System.out.println(equalsIgnoreCase(str1, str2));
    }//from   w  w  w .  jav a 2 s.  c  om

    public static boolean equalsIgnoreCase(String str1, String str2) {
        if (str1 == null) {
            return str2 == null;
        }

        return str1.equalsIgnoreCase(str2);
    }
}