|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
ArrayList and type the return Hello i have a probleme with my class essentielly with my method look my class import java.util.ArrayList; import java.util.Iterator; Code: public class Personne { ArrayList persones=new ArrayList<Personne>(); private long id; private String nom=""; public long getId(){ return id; } public String getNom(){ return nom; } public long setId(long id){ return id=id; } public String setNom(String nom){ return nom=nom; } //here the problem the return public String getPersone(){ Iterator iterateur=persones.iterator(); while(iterateur.hasNext()){ long id=((Personne)iterateur.next()).getId(); String nom=((Personne)iterateur.next()).getNom(); return id+""+nom; } return null; } public static void main(String arg[]){ Personne p1=new Personne(); p1.setNom("Amine"); p1.setId(0xAA3567B2C4FL); Personne p2=new Personne(); p2.setId(0xAA93B10CD00L); p2.setNom("Ali"); } } |
#2
| |||
| |||
Re: ArrayList and type the return Service operations can only operate on concrete implementations. This is not a limitation of WCF, this is a limitation (or, feature) of WSDL. So, if you want to accept any type to a generic Load() operation, and specify the type in the call, you'll have to design a contract that receives the type T as a parameter, and returns a List<object> or object[] that is an array of that type. I think you are fixated on the syntax looking like remoting, and generics...when what you really want is a solution that fits with semantics of service design. Why not this? List<object> Load(string objectType); |
#3
| |||
| |||
Re: ArrayList and type the return thanks , my probleme concerne my methode getPersonne returns the id and name |
![]() |
|
Tags: arraylist, java |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Content Type | Mime Type for Office 2010 file format and extension | ramsun | Tips & Tweaks | 1 | 16-08-2010 05:25 PM |
Content Type | Mime Type for Office 2007 file format and extension | D_chapple | Tips & Tweaks | 1 | 16-08-2010 04:44 PM |
Implement the return type in java | Captain Carrot | Software Development | 4 | 25-03-2010 01:34 PM |
Incorrect return of ArrayList | Gunner 1 | Software Development | 5 | 13-02-2010 04:34 AM |
Static types can we used as return type | ComPaCt | Software Development | 2 | 12-06-2009 03:37 PM |