Java Vector Intersect intersection(Vector a, Vector b)

Here you can find the source of intersection(Vector a, Vector b)

Description

intersection

License

Open Source License

Declaration

public static Vector intersection(Vector a, Vector b) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {
    public static Vector intersection(Vector a, Vector b) {
        Vector r = new Vector();
        for (int i = 0; i < a.size(); i++) {
            for (int j = 0; j < b.size(); j++) {
                if (a.elementAt(i).equals(b.elementAt(j)))
                    r.add(a);//  w ww.  jav  a2s.  com
            }
        }
        return r;
    }
}

Related

  1. intersection(Vector vectA, Vector vectB)