Shannon Anderson-Rush
Test por , creado hace más de 1 año

AP Computer Science Test sobre String Method Review, creado por Shannon Anderson-Rush el 05/10/2020.

1186
0
0
Shannon Anderson-Rush
Creado por Shannon Anderson-Rush hace más de 3 años
Cerrar

String Method Review

Pregunta 1 de 2

1

Consider the following code segment:
String newString = "Welcome";
String anotherString = "Home";
newString = anotherString + "Hello";
What is the value of newString?

Selecciona una de las siguientes respuestas posibles:

  • HomeHello

  • HelloHello

  • WelcomeHello

  • Welcome Hello

  • Home Hello

Explicación

Pregunta 2 de 2

1

Which of the following returns the last character of the string str?

Selecciona una de las siguientes respuestas posibles:

  • str.substring(0);

  • str.substring(0, str.length());

  • str.substring(length(str));

  • str.substring(str.length()-1);

  • str.substring(str.length());

Explicación