This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
The | and || are OR operators while & and && are AND operators. The || and && are considered short-circuit operators; giving it the potential to just execute the code on the left-hand side. The | and & will always execute both sides. i.e. String s1 = null; //once it realizes that s1 is null it will not execute s1.equals //this comes in handy in this situation becuase if you call .equals on a //null object it will throw a NullPointerException if(s1 == null || s1.equals("")) //this throws a NullPointerException if(s1 == null | s1.equals(""))
"ada ada" and "java raid", Welcome to the JavaRanch! However... The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp. We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements. Thanks. Dave