P

Priyanka Tomar • 35.28K Points
Coach

Q. What will be the output of the following Java program?
class output
{
public static void main(String args[])
{ String s = "Hello World";
int i = s.indexOf('o');
int j = s.lastIndexOf('l');
System.out.print(i + " " + j);

}
}

  • (A) 4 8
  • (B) 5 9
  • (C) 4 9
  • (D) 5 8
  • Correct Answer - Option(C)
  • Views: 87
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics