Spring Semester Flashcards
1
Q
what does length() do?
A
counts character
2
Q
what does trim() do?
A
gets rid of only leading and trailing whitespace, tab characters, spaces, and etc
3
Q
what is the syntax for equals()? what does it take in? what does it return?
A
s1.equals(s2); takes in a string object and returns a boolean
4
Q
define ==
A
compares memory address of two objects to see if they point to the same place
5
Q
setter AKA as ?
A
mutator
6
Q
getter AKA as ?
A
accessor
7
Q
overloaded methods are
A
two methods with the same name, can only exist if those methods take in different parameters
8
Q
define immutable
A
cannot be changed this is a property of strings
9
Q
what is concatination
A
to combine strings with ex: “hello” + “world”