August 8, 2000

DevX - Software Development Resource

Escaped Characters

Question: When defining a string, is there a way to include a carriage return in the text? Answer: Yes. A carriage return is represented by the special escapedcharacter . However,

DevX - Software Development Resource

Use “.equals” in Place of “==”

Java provides two methods to test for equality: the == Operator and the .equals method. The .equals is implemented by all objects. Most programmers tend to use == for equality,