- Draw students’ attention to the fact that Strings are Objects, but, because they can’t be modified, work more like a primitive when you initialize them and when you pass them between methods.
- When you initialize a String in Java, it can look very similar to initializing an int!
String s = "cat"; int x = 7;
- One way to help students recognize how strings are like Objects is to point out the need for using the keyword new when use the String constructor.
String s = new String("cat");