Spring Semester Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

what does length() do?

A

counts character

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

what does trim() do?

A

gets rid of only leading and trailing whitespace, tab characters, spaces, and etc

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

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

define ==

A

compares memory address of two objects to see if they point to the same place

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

setter AKA as ?

A

mutator

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

getter AKA as ?

A

accessor

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

overloaded methods are

A

two methods with the same name, can only exist if those methods take in different parameters

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

define immutable

A

cannot be changed this is a property of strings

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

what is concatination

A

to combine strings with ex: “hello” + “world”

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