How does indexof work?



How does indexof work?..

Answer / Priya Singh

indexOf in Java is a method used to find the index of a specific character or substring within a String. If found, it returns the first index; otherwise, it returns -1.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

How does hashmap work in java ?

1 Answers  


Differentiate between a constructor and a method? Can we mark constructors final?

1 Answers  


which one the better thread emplemented thread or extended ?

4 Answers   Fidelity,


what really hapens when a object is created using new operator? 1.is it allocates memory to all variables and methods in the class with reference to that object?

3 Answers  


What are the steps to do connection pooling in weblogic?

1 Answers   TCS,


what is the purpose of "virtual"?

1 Answers   EDS,


What is difference between calling start() and run() method of thread?

1 Answers  


What is meant by class loader? How many types are there? When will we use them?

1 Answers  


Can you pass functions in java?

1 Answers  


What is string immutability?

1 Answers  


How do you implement polymorphism in our day to day life?

1 Answers   Cap Gemini,


What is singleton pattern?

1 Answers  


Categories