Hello

Lets say I have these two classes;

public class BFF{
    private String name;
    private String surname;
    private Object friendships;
}
public class BFFG<T>{
    private String name;
    private String surname;
    private T friendships;
}

Is it possible to create a generic method that could create a Set of the information encapsulated in both BFF classes? So that I could ultimatively do something like this:

setOne<BFF> = fillSet();
setTwo<BFF<>> = fillSet();

Thank you for any info

Joey

If I understand your question, then yes. eg
ArrayList<String> = ...
ArrayList<Vector<String>> = ...
etc

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.