# Java: String Exercises 1 - Answers

Answers to the String Exercises 1.

1. 3 -- s refers to exactly the same string as a.
2. ERROR -- t is a local variable, and it must be assigned a value first.
3. "1abc" -- + means concatenation here because an operand is type String
4. "ABC"
5. 4
6. 6
7. "mo"
8. false -- the string is "3abc"
9. true -- they are the same string (== to test for same objects)
10. true -- Use .equals to test for same value. Here it is likely that a.substring(1,3) == "bc" is false.