| | | What makes Strings unique among Java Object types? |
What makes Strings unique among Java Object types?
We've learned that many types in Java fall neatly into one of two
categories:
- Object types (FilledRect, Text, Choice)
- Described by a class definition
- Created using constructor and "new" command
- Manipulated through invocation of methods.
- Non-object (primitive) types (int, boolean, double)
- Members of each of these types are described by
constants such as 3, true, 49.7
- Manipulated through operator symbols like +, &&, *
Java considers String to be an object type. But Strings share
features with both object and non-object types.
- Can be created using a constructor and "new" command.
- Can be described by constants ("hello")
- Can be manipulated using an operator symbol (+)
- Can be manipulated by invoking methods. In fact, there are
over 50 methods in the String class!
| | | What makes Strings unique among Java Object types? |