Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Doubt on Generi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 15863 of 16566
Post > Topic >>

Doubt on Generics and Interfaces

by Vinicius Cubas Brand <viniciuscb@[EMAIL PROTECTED] > Mar 6, 2008 at 06:33 AM

Hello. I have implemented an interface "ComboItem" and a class
implementing this interface, named "****tadorDireito". This class
"****tadorDireito" is abstract and is extended by the class
"Operador".

In another class, I have a method that receives a list of ComboItem,
like this:

im****t java.util.List;

class TesteAction {

   public void teste (String x, String y, List<ComboItem> options,
ComboItem default) {
   ...
   }

}


Then, when using this method TesteAction.teste(), I am passing a
List<Operador> as parameter, like this:

testeAction x = new TesteAction();
x.teste(String a, String b, List<Operador> c, Operador d)

The compiler is not accepting, so I must have done something wrong
with generics, or forgot to implement something. Do you have hints on
what I am doing wrong?

also the following gives error also, but different:

x.teste(String a, String b, List<Operador> c, null)


Below follow the error for the first case:

Caused by: java.lang.Error: Unresolved compilation problem:
	The method adicionarFiltroCombo(String, String, List, ComboItem,
String, boolean) in the type RelatorioAction is not applicable for the
arguments (String, String, List, Operador, String, boolean)

and for the second case:

Caused by: java.lang.Error: Unresolved compilation problem:
	The method adicionarFiltroCombo(String, String, List, ComboItem,
String, boolean) in the type RelatorioAction is not applicable for the
arguments (String, String, List, null, String, boolean)


Thank you.
 




 8 Posts in Topic:
Doubt on Generics and Interfaces
Vinicius Cubas Brand <  2008-03-06 06:33:58 
Re: Doubt on Generics and Interfaces
Koos Pol <koos.pol@[EM  2008-03-06 07:22:37 
Re: Doubt on Generics and Interfaces
Daniel Pitts <newsgrou  2008-03-06 07:28:50 
Re: Doubt on Generics and Interfaces
Hendrik Maryns <gtw37b  2008-03-06 16:29:21 
Re: Doubt on Generics and Interfaces
Roedy Green <see_websi  2008-03-15 06:44:43 
Re: Doubt on Generics and Interfaces
"John B. Matthews&qu  2008-03-15 09:18:59 
Re: Doubt on Generics and Interfaces
Roedy Green <see_websi  2008-03-28 20:30:12 
Re: Doubt on Generics and Interfaces
Roedy Green <see_websi  2008-03-28 23:04:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 16:31:05 CST 2008.