163k views
17 votes
If String str = "Computer Science";, then what is the value of str.substring(10);? ​

User Ikettu
by
4.9k points

1 Answer

6 votes

Answer:

cience

Step-by-step explanation:

From the question, the string variable str was initialized to "Computer Science:

str.substring(10) implies that we get a substring starting from the character at the 10th index till the last index

In this case, the 10th index character is c

So, the instruction will return cience

User Colin Claverie
by
4.5k points