Java Vector isEmpty() MethodLast Updated : 17 Mar 2025 The isEmpty() method of Java Vector class is used to check if this vector has no components. It returns true if the vector is empty, otherwise returns false. SyntaxFollowing is the declaration of isEmpty() method: ParameterThis method does not accept any parameter. ReturnThe isEmpty() method returns true if and only if this vector has no components, otherwise returns false. ExceptionsNA Compatibility VersionJava 1.2 and above Example 1Output: Vector: [Java, Ruby, Android, Python] Is the Vector empty? = false Vector after clear(): [] Is the Vector empty? = true Example 2Output: Vector: [] Is the Vector empty? = true Example 3Output: Vector isEmpty() before? false Vector isEmpty() after ? 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