String Handling — Chapter Test

Answer all 5 questions, then submit. You need 60% to pass. Log in to save progress.

Question 1
For String s = "Hello", what does s.charAt(1) return?
A'H'
B'e'
C'l'
D'o'
Question 2
Which method gives the number of characters in a String?
Asize()
Blength()
Ccount()
DcharAt()
Question 3
To correctly compare the CONTENTS of two Strings you use…
A==
Bequals()
CcompareTo() only
DcharAt()
Question 4
A word that reads the same forwards and backwards is a…
Asubstring
Bpalindrome
CPig Latin word
Dtoken
Question 5
s.substring(0, 3) of "Vidaara" returns…
A"Vida"
B"Vid"
C"ida"
D"V"