[ Java Vector](#)
`addElement(Object obj)` is a method provided by the `Vector` class, used to add an element to the end of a `Vector`.
`addElement(Object obj)` adds the specified object as a component to the end of this vector, increasing its size by 1. If the size of the vector exceeds its capacity, its capacity is increased.
### Syntax
public void addElement(Object obj)
### Parameters
* `obj`: the element to be added to the `Vector`
### Return Value
This method has no return value (void)
* * *
## Examples
Let's understand how to use the `addElement()` method through several examples.
### Basic Usage
## Example
import java.util.Vector;
public class VectorExample {
public static void main(String[] args){
// Create a Vector object
Vector vector =new Vector();
// Use addElement() method to add elements
vector.addElement("Apple");
vector.addElement("Banana");
vector.addElement("Cherry");
// Print Vector contents
System.out.println("Vector: "+ vector);
}
}
**Output:**
Vector: [Apple, Banana, Cherry]
### Adding Different Types of Elements
## Example
import java.util.Vector;
public class MixedVectorExample {
public static void main(String[] args){
Vector