Java Vector contains() MethodLast Updated : 17 Mar 2025 The contains() method of Java Vector class is used to check the vector which is in use contains the specified element or not. It returns true if this vector contains the specified element, otherwise returns false. Syntax:Following is the declaration of contains() method: Parameter:
Returns:The contains() method returns true if this vector contains the specified element, otherwise returns false. Exceptions:NA Compatibility Version:Java 1.2 and above Example 1:Output: Java is present at the index 1 Example 2:Output: Existence: true Next TopicJava Vector |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India