String, StringBuilder, Arrays & ArrayList Flashcards

1
Q

Can the size of an array be specified when it is declared?

A

No. The size of the array comes from the initialisation on the right hand side of the assignment.

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

Can an array be initialised and have space explicitly assigned?

A

No. This will not compile if you try to initialise the array and explicitly create space as part of the initialisation of the array.

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

Describe all String methods and their nuansances

A
charAt()
concat()
equalsIgnoreCase()
length()
replace()
substring()
toLowerCase()
toString()
toUpperCase()
trim()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the substring method on String

A

Arrays are indexed beginning at 0 and when you substring them the second parameter is not indexed at position 0. No second parameter will substring to the end of the String object.

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

Describe the trim method on String

A

trims BOTH trailing and leading white space.

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