Online Java Compiler By
JavaTpoint.com
import java.util.*; public class VectorIsEmptyExample2 { public static void main(String arg[]) { //Create an empty Vector with initial capacity of 5 Vector
vecObject = new Vector
(5); //Display the Vector System.out.println("Vector: " +vecObject); //Verifying if the Vector is empty or not System.out.println("Is the Vector empty? = " +vecObject.isEmpty()); } }
Output