Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to specify an undetermined Object (Generic) as parameter in method() ?

Reply
Thread Tools

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

 
 
Gianni Galore
Guest
Posts: n/a
 
      01-18-2011
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to specify a parameter Luca D. Java 13 03-19-2008 09:47 PM
Please Tell Me How to specify the parameter. Chuck Insight ASP .Net Web Controls 6 03-22-2005 01:31 AM
[JWS] How to specify a parameter to a JWS application? BdS Java 0 06-09-2004 09:00 AM
Help attaching validator controls to an undetermined number of contorls in a repeater Simon ASP .Net 1 05-17-2004 04:12 AM



Advertisments