Consider below one :
Object nothingToHold = null; System.out.println(nothingToHold); // Safely prints \'null\'
Here, Sysout must be expe
Object nothingToHold = null; System.out.println(nothingToHold != null ? nothingToHold : "null String or any thing else");
This will display output if the nothingToHold(Object) not equals to null, otherwise it prints the message as "null String or any thing else"