Strings Flashcards

1
Q

Conceptually, what is a String?

A

A String is a data type that represents text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Is a String a value or reference type?

A

Reference type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How many bytes in a String?

A

22 bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How many bytes in a character?

A

1 byte

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a char?

A

A single text character.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give 3 examples of reference types.

A

String, Scanner, Random

How well did you know this?
1
Not at all
2
3
4
5
Perfectly