Java Vector isEmpty() MethodThe 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 1Test it NowOutput: Vector: [Java, Ruby, Android, Python] Is the Vector empty? = false Vector after clear(): [] Is the Vector empty? = true Example 2Test it NowOutput: Vector: [] Is the Vector empty? = true Example 3Test it NowOutput: Vector isEmpty() before? false Vector isEmpty() after ? true Next TopicJava Vector |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India