Vidyalelo
Java Programming · Q103

Strings

Programming · Java Programming · question 103

Q103

What will be the output of the following Java code? class output public static void main(String args[]) String a = "hello i love java"; System.out.println(a.indexOf('i')+" "+a.indexOf('o') +" "+a.lastIndexOf('i')+" "+a.lastIndexOf('o'));

A.
6 4 6 9
Answer
B.
5 4 5 9
C.
7 8 8 9
D.
4 3 6 9

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board