Ask Question
12 November, 04:05

What is the output of this program?

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'));

}

+1
Answers (1)
  1. 12 November, 07:00
    0
    6 + 4 + 6 + 4

    Explanation:

    It will start from index 0 and wherever you find the character inside the indexOf methods then you will note it down.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is the output of this program? class output { public static void main (String args[]) { String a = "hello i love java"; System. out. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers