StringBuffer sb=null; // Some more logic that conditionally assigns value to the StringBuffer // Prints Value=null System.out.println(\"Value=\"+sb); // Throws Nu
A + has a higher precedence than a !=.
+
!=
So you evalutate "(Value="+sb ) != null at first.
"(Value="+sb ) != null