Jump to content

POWERED BY:

Archived

This topic is now archived and is closed to further replies.

Symphony-X

ArrayList tipado em C#

Recommended Posts

Opa!

 

Programo e estudo a algum tempo a linguagem JAVA e a pouco tempo atrás estou trabalhando com C#.

 

Minha duvida é a seguinte:

 

No Java, eu consigo declarar um ArrayList tipado da seguinte maneira:

 

CODE
ArrayList<Cliente> clientes = new ArrayList<Cliente>();

 

Tentei fazer dessa mesma forma no C#, porem aparece o erro:

The non-generic type 'System.Collections.ArrayList' cannot be used with type arguments

 

Alguem tem ideia de como posso resolver isso?

 

Obrigado desde já!

Share this post


Link to post
Share on other sites

Acho que o que quer é:

ArrayList clientes = new  ArrayList();

De uma olhada nesses links que podem te auxiliar:

http://www.arquivodecodigos.net/arquivo/vi...?qual_dica=1813

http://www.dotnetspider.com/kb/Article17.aspx

http://msdn2.microsoft.com/en-us/library/s...ist(VS.71).aspx

 

Abraços...

Share this post


Link to post
Share on other sites

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.