Vector Class in Java

Vector is a concrete class in Collection Framework. It is a dynamic representation of array and is synchronized. Since the vector is synchronized so it is a better choice for thread-safe operation. Synchronization is a process through which an object can be locked for a given thread and other thread cannot use that object when it is locked.

Example:
—MyVector.java—

 OUTPUT:

Vector-Output

Leave a Reply

Contact Us
close slider
Contact Us

How can we help you with?