Character and string Methods Flashcards
(81 cards)
A ___________ is not a simple data type but a reference—it holds a memory address, not the actual
value.
String variable
A String variable is _____________ but a reference—it holds a memory address, not the actual
value.
not a simple data type
A String variable is not a simple data type but a _________—it holds a memory address, not the actual
value.
reference
A String variable is not a simple data type but a reference—it holds a _____________, not the___________.
memory address
actual value
When you use __ to compare two
Strings, you’re comparing their _____________, not their ________.
==
memory addresses
actual values
_________ usually want to compare the values
of Strings, not their memory addresses.
Programmers
Programmers usually want to compare the ___________, not their___________.
values of Strings
memory addresses
______________:
Holds a single character
Character Class
Character Class:
Holds a _________
single character
______________:
Provides methods to manipulate and inspect
single-character data.
Character Class
Character Class:
Holds a single character (e.g., ‘A’, ‘8’, ‘$’).
Provides methods to ________ and ______________.
manipulate
inspect single-character data
___________:
Used for fixed (unchanging) text data made
up of one or more characters.
Offers many methods to simplify working with
Strings.
String Class
String Class:
Used for_______________ made
up of _______________.
Offers many methods to simplify working with
Strings.
fixed (unchanging) text data
one or more characters
The _____________:
Used to store a single character, such as a
letter, digit, or punctuation mark.
char Data Type
The char Data Type:
Used to _____________, such as a
letter, digit, or punctuation mark.
store a single character
The char Data Type:
Used to store a single character, such as a
_______,________, or_____________.
letter
digit
punctuation mark
char literals are written inside_______________
single quotation
marks
Since char is a _____________, it holds
actual values (not memory addresses).
primitive data type
Since char is a primitive data type, it holds
___________ (_________).
actual values
not memory addresses
You can compare char values using _______________ like == and >.
relational operators
Comparisons are based on the ________ value of
each character.
Unicode
These comparisons work as you’d expect—
_____________.
alphabetically
Java also provides a _________ for working
with characters.
Character class
This class includes useful methods for_______ and
__________ character values.
testing
manipulating