Final answer:
The substring "acd" can be obtained from the string "aqcqdps" by correctly slicing the string with option b) banner[1:4].
Step-by-step explanation:
To get the substring "acd" from the banner variable which has the value "aqcqdps", you need to slice the string using the correct indices. The substring "acd" starts from the index 1 and ends before index 4 in the given string. Therefore, the correct option to extract "acd" from "aqcqdps" is option b) banner[1:4].In Java, Substring is a part of a String or can be said subset of the String. There are two variants of the substring () method. This article depicts all of them, as follows : 1. String substring () The substring () method has two variants and returns a new string that is a substring of this string.