Inside of class ATester
{
private A<Integer> p1,p2;
p1 = new B<Integer>();
p2 = new B<Integer>( p1);
}
public class B<E extends Comparable<? super E>> implements A<E>
{
public B() // default constructor
{
// skip
}
public B(B other) // copy constructor
{
// skip
}
}
I want to define a copy constructor, which takes another B as argument but when I pass p1 into
p2 = new B<Integer>( p1);
when compile, it gives me error message
"no suitable constructor found for B< A < Integer > >"
What should I change or add?
public B(B other)topublic B(B<E> other).