How to specify an undetermined Object (Generic) as parameter in method() ?

G

Gianni Galore

Assume I have a method similar to

public Set <AAA> myMethod ( ...???..., Set <BBB> inparm2) {
...
}

What do I have to fill in "???" to be able to pass various different objects.
In other words afterwards calls like the following should be valid:

CCCType c = new CCCType();
DDDType d = new DDDType();
.....

.... = myMethod(c, ....);

or

.... = myMethod(d, ...);

Is there something like:

public Set <AAA> myMethod ( Object<> inparm1, Set <BBB> inparm2) {
...
}



Gianni
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top