Bonjour à tous,
J'ai une interface :
Et une classe qui implemente cette interface :Code:
1
2
3
4
5
6
7 public interface GAuthentification { .... static GAuthentification charger(String path) throws IOException; .... }
Et il me fait plusieurs erreures :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 public class TAuthentification implements GAuthentification, Serializable { .... public static GAuthentification charger(String path) { GAuthentification tmp = new TAuthentification(); try{ ObjectInputStream in = new ObjectInputStream(new FileInputStream(path)); tmp=(TAuthentification)in.readObject(); in.close(); }catch(IOException e){ e.printStackTrace(); }catch(ClassNotFoundException e){ e.printStackTrace(); } return tmp; } ..... }
dans la classe TAuthentifaction :
dans l'interface GAuthentification :Code:This static method cannot hide the instance method from GAuthentification
Avez vous une idée ? Je voudrais vraiment réaliser cette méthode en static.Code:
1
2 Illegal modifier for the interface method GAuthentification.charger(); only public & abstract are permitted
Mais je n'ai pas tout saisi de l'utilisation d'une methode static sans doute.
Je vous remercie de toutes les reponses que vous pourrez me fournir.