filmov
tv
Java Practice It | Self-Check 8.3: StringObject | objects, definition, state, strings

Показать описание
More practice its:
Problem:
Question:
What is the state and behavior of a String object?
The state is the memory occupied by the object, and the behavior is what you do with that memory, such as storing characters in it.
The state is methods that return values, such as length or charAt, and the behavior is methods that change the string, such as toUpperCase or substring.
The state is its sequence of characters, and the behavior is its methods, such as length and indexOf.
The state is the location the text came from, such as a file or from the Scanner, and the behavior is when you save that string to a new location, such as to a new file.
The state is the string itself, and the behavior is what you do with it, such as putting it in an array or list.
(order shuffled)
Problem:
Question:
What is the state and behavior of a String object?
The state is the memory occupied by the object, and the behavior is what you do with that memory, such as storing characters in it.
The state is methods that return values, such as length or charAt, and the behavior is methods that change the string, such as toUpperCase or substring.
The state is its sequence of characters, and the behavior is its methods, such as length and indexOf.
The state is the location the text came from, such as a file or from the Scanner, and the behavior is when you save that string to a new location, such as to a new file.
The state is the string itself, and the behavior is what you do with it, such as putting it in an array or list.
(order shuffled)