aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Basics (GATE - CS)
  • Which of the following data types can be passed as the fi...
Multiple choice

Which of the following data types can be passed as the first parameter to the lastIndexOf() method in String class?

  1. Char

  2. String

  3. Int

  4. Both (1) and (2)

  5. All of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Both char and string can be passed as the first parameter to the lastIndexOf() method. So this is the correct answer.

Keep practicing — related questions

  • Which of the following methods in string class of java searches for the last occurrence of a character or s...
  • String s = “Welcome To Java” s.lastIndexOf(“Java”,5); What is the result of the given code?
  • String s = “Welcome To Java” s.lastIndexOf(“Java”,5); What is the result of the given statements?
  • Which of the following methods of String class searches for the first occurrence of a character or substring?
  • What is the result of the given statements? String s = “Welcome To Java” s.lastIndexOf(“Java”,5);
  • Which of the following searches for the first occurrence of a character or substring?
  • Which of the following string manipulation methods returns index position of first occurrence of characters...
  • Which of the following functions in Java searches for the last occurrence of a character or a substring?
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Java Core Classes and Threads (1473 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy