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);

d) String prefix = listing.substring(0,5);

Computer Science & Information Technology

You might also like to view...

________ is the arrangement of objects on a slide

A) Slide transition B) Slide design C) Slide layout D) Slide master

Computer Science & Information Technology

Microsoft Edge's ________ feature provides a place to save webpages that you can look at later

A) Reading View B) SmartScreen Filter C) Screen Reader D) Reading List

Computer Science & Information Technology