Bonjour à tous,

J'ai une interface :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
public interface GAuthentification {
	        ....	
		static GAuthentification charger(String path) throws IOException;
	        ....
 
}
Et une classe qui implemente cette interface :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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;
	}
        .....
}
Et il me fait plusieurs erreures :
dans la classe TAuthentifaction :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
This static method cannot hide the instance method from GAuthentification
dans l'interface GAuthentification :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
Illegal modifier for the interface method GAuthentification.charger(); only public & abstract are 
 permitted
Avez vous une idée ? Je voudrais vraiment réaliser cette méthode en static.
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.