I'm new to java, I have the code below (v is a vector) and I don't understand this:
(Customer) v.get(i)
Please explain to me .tks
public void insert(Customer c) {
boolean checkExist = true;
if (checkExist && !isIn(c,v)) {
for (int i = 0; i < v.size(); i++) {
int check = c.compareTo((Customer) v.get(i));
if (check < 0) {
Customer x = new Customer();
x = (Customer) v.get(i);
v.set(i, c);
c = x;
}
}
v.add(c);
}
}
public boolean isIn(Customer c, Vector els) {
c = new Customer();
for (int i = 0; i < els.size(); i++) {
if (c.equals(els.get(i))) {
return true;
}
}
return false;
}