Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
5865 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  question POO

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

question POO

n°1543050
root76
Posté le 15-04-2007 à 18:07:48  profilanswer
 

Bonjour,
 
Je voudrais comprendre uun truc dans un ocde que j'ai récupéré, en fait , quand on a une Interface ImyInerface et une classe MyClass qui l'implémente
 

Code :
  1. Interface ImyInterface {
  2. public void myFunc(String i);
  3. }
  4. ------------------ 
  5. MyClass implements ImyInterface{
  6. String toto;   Myclass(){ //constructeur }  
  7. public void myFunc(String i){
  8. ///implémentationnde la méthode
  9. }   
  10. }


 
Ma question est c'est quoi l'intérêt de faire
 
ImyInterface MyInst = new MyClass();
 
au lieu de :
 
MyClass MyInst = new MyClass();
 
Merci


Message édité par root76 le 15-04-2007 à 18:09:47
mood
Publicité
Posté le 15-04-2007 à 18:07:48  profilanswer
 

n°1543053
masklinn
í dag viðrar vel til loftárása
Posté le 15-04-2007 à 18:17:18  profilanswer
 

http://forum.hardware.fr/hfr/Progr [...] m#t1296679


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  question POO

 

Sujets relatifs
question sur les datesJavascript et POO
[C] Question sur l'allocation dynamiqueQuestion sur API windows VB Word
Question de conception d'une tablequestion POO
[Résolu] Question Poo en delphi[Résolu] POO question hype débutant
[PHP] Question POO / pointeurs [résolu- presque]Question nul sur la POO
Plus de sujets relatifs à : question POO


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)