Skip to main content

Unit 1 · Using Objects and Methods

substring and indexOf

substring and indexOf MCQ Practice

Question 1 of 15

Answered 0 of 15

Choose one answer.

What is printed by the following code segment?

String s = "alphabet";
System.out.print(s.indexOf("ph"));
Choose one answer.