This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
#1 does not throw a Null Ponter Exception where as #2 throws.
#1 : equalsIgnoreCase allows null values to be passed as a parameter. Its returned value will be true if the argument is not null and it represents an equivalent String ignoring case; false otherwise.
#2 : Trying to call a method on a null object will always throw a NullPointerException