Strings Flashcards
1
Q
Conceptually, what is a String?
A
A String is a data type that represents text.
2
Q
Is a String a value or reference type?
A
Reference type
3
Q
How many bytes in a String?
A
22 bytes
4
Q
How many bytes in a character?
A
1 byte
5
Q
What is a char?
A
A single text character.
6
Q
Can I alter a String? How?
A
Strings are immutable. Once you have created a string you cannot later change that string object.
BUT
You can modify them by using substring(), concat(), replace(), trim(), etc.
7
Q
Give 3 examples of reference types.
A
String, Scanner, Random