Ask Question
Today, 15:19

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. Today, 19:02
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers