Multiple Choice
Suppose we have a String object referenced by a variable called listing. Suppose we want a new String object that consists of the first 5 characters in listing. Which of the following lines of code will achieve this?
A) String prefix = listing.front(5) ;
B) String prefix = listing.front(6) ;
C) String prefix = listing.substring(1,5) ;
D) String prefix = listing.substring(0,5) ;
E) String prefix = listing.firstChars(5) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q21: Write a single statement that creates a
Q22: Suppose a Random object has been created
Q23: Which of the following represents the proper
Q24: Which of the following best describes what
Q25: Multiple reference variables can refer to the
Q27: Consider the following snippet of code: Random
Q28: When there are no references to an
Q29: _ is the automatic conversion between a
Q30: What is output by the following code
Q31: Write a declaration for an enumerated type