Certification Summary


If you've studied this chapter diligently, you should have a firm grasp on Java operators, and you should understand what equality means when tested with the == operator. Let's review the highlights of what you've learned in this chapter.

The logical operators (&.& , | | ,&,|, and ^) can be used only to evaluate two boolean expressions. The difference between && and & is that the && operator won't bother testing the right operand if the left evaluates to false, because the result of the && expression can never be true. The difference between | | and | is that the | | operator won't bother testing the right operand if the left evaluates to true, because the result is already known to be true at that point.

The == operator can be used to compare values of primitives, but it can also be used to determine whether two reference variables refer to the same object.

The instanceof operator is used to determine if the object referred to by a reference variable passes the IS-A test for a specified type.

The + operator is overloaded to perform string concatenation tasks, and can also concatenate Strings and primitives, but be careful—concatenation can be tricky.

The conditional operator (a.k.a. the "ternary operator") has an unusual, three-operand syntax—don't mistake it for a complex assert statement.

The ++ and -- operators will be used throughout the exam, and you must pay attention to whether they are prefixed or postfixed to the variable being updated.

Be prepared for a lot of exam questions involving the topics from this chapter. Even within questions testing your knowledge of another objective, the code will frequently use operators, assignments, object and primitive passing, and so on.




SCJP Sun Certified Programmer for Java 5 Study Guide Exam 310-055
SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055) (Certification Press)
ISBN: 0072253606
EAN: 2147483647
Year: 2006
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net