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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top