Examveda
Examveda

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

Answer: Option C


This Question Belongs to Java Program >> Strings

Join The Discussion

Related Questions on Strings