πŸ“Š JAVA
Q. What will be the output of the following Java code?
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
  • (B) 5 4 5 9
  • (C) 7 8 8 9
  • (D) 4 3 6 9
πŸ’¬ Discuss
βœ… Correct Answer: (A) 6 4 6 9

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
83
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Pooja
Publisher
πŸ“ˆ
86%
Success Rate