String Method Review

Description

AP Computer Science Quiz on String Method Review, created by Shannon Anderson-Rush on 05/10/2020.
Shannon Anderson-Rush
Quiz by Shannon Anderson-Rush, updated 7 months ago
Shannon Anderson-Rush
Created by Shannon Anderson-Rush about 4 years ago
1203
0

Resource summary

Question 1

Question
Consider the following code segment: String newString = "Welcome"; String anotherString = "Home"; newString = anotherString + "Hello"; What is the value of newString?
Answer
  • HomeHello
  • HelloHello
  • WelcomeHello
  • Welcome Hello
  • Home Hello

Question 2

Question
Which of the following returns the last character of the string str?
Answer
  • str.substring(0);
  • str.substring(0, str.length());
  • str.substring(length(str));
  • str.substring(str.length()-1);
  • str.substring(str.length());
Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr