programmation orienté objet applications au langage java cours « 2 » : héritage, exception, i/o
TRANSCRIPT
![Page 1: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/1.jpg)
Programmation Orienté Objetapplications au langage Java
Cours « 2 » : Héritage, exception, I/O
![Page 2: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/2.jpg)
Héritage
![Page 3: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/3.jpg)
Spécialisation
![Page 4: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/4.jpg)
Classes et sous-classes
![Page 5: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/5.jpg)
Classes et sous-classes
![Page 6: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/6.jpg)
Généralisation et spécification
![Page 7: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/7.jpg)
Exemple d’héritage
![Page 8: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/8.jpg)
Héritage et Java
![Page 9: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/9.jpg)
Héritage à plusieurs niveau
![Page 10: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/10.jpg)
Surcharge et redéfinition
![Page 11: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/11.jpg)
Surcharge et redéfinition
![Page 12: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/12.jpg)
Surcharge et redéfinition
![Page 13: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/13.jpg)
Redéfinition avec réutilisation
![Page 14: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/14.jpg)
Redéfinition avec réutilisation
![Page 15: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/15.jpg)
Usage des constructeurs
![Page 16: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/16.jpg)
Accès au membre des superclasses
![Page 17: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/17.jpg)
Exemple : la classe Point
![Page 18: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/18.jpg)
Exemple : la classe PointCouleur
![Page 19: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/19.jpg)
Exemple d’utilisation
![Page 20: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/20.jpg)
Polymorphisme
![Page 21: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/21.jpg)
Polymorphisme : surclassement
![Page 22: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/22.jpg)
Polymorphisme : surclassement
![Page 23: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/23.jpg)
Polymorphisme : surclassement
![Page 24: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/24.jpg)
Polymorphisme
![Page 25: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/25.jpg)
La classe Objet
![Page 26: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/26.jpg)
La classe Objet
![Page 27: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/27.jpg)
La classe Pers
![Page 28: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/28.jpg)
Illustration du polymorphisme
![Page 29: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/29.jpg)
La classe Etudiant
![Page 30: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/30.jpg)
Illustration du polymorphisme
![Page 31: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/31.jpg)
Polymorphisme : pourquoi faire?
![Page 32: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/32.jpg)
Exemple typique
![Page 33: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/33.jpg)
Méthodes et classes finales
![Page 34: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/34.jpg)
Les packages
![Page 35: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/35.jpg)
Utilisation des classes
![Page 36: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/36.jpg)
Jar
![Page 37: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/37.jpg)
Exception
![Page 38: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/38.jpg)
Exception
![Page 39: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/39.jpg)
Exception : lancer ou déclancher
![Page 40: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/40.jpg)
Exception : capturer ou attraper
![Page 41: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/41.jpg)
Exception : capturer ou attraper
![Page 42: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/42.jpg)
Exception : modélisation
![Page 43: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/43.jpg)
Exception : modélisation
![Page 44: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/44.jpg)
Exception : modélisation
![Page 45: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/45.jpg)
Exception : finally
![Page 46: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/46.jpg)
Exception : finally
![Page 47: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/47.jpg)
Exception : pour ou contre?
![Page 48: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/48.jpg)
Exception : pour ou contre?
![Page 49: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/49.jpg)
Les flux
![Page 50: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/50.jpg)
Les flux
![Page 51: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/51.jpg)
Les flux
![Page 52: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/52.jpg)
Les flux de caractères
![Page 53: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/53.jpg)
Les flux de caractères
![Page 54: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/54.jpg)
Les flux de caractères
![Page 55: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/55.jpg)
Les flux binaires
![Page 56: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/56.jpg)
La classe file
![Page 57: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/57.jpg)
La classe InputStreamReader
![Page 58: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/58.jpg)
Lecture d’un caractère au clavier
![Page 59: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/59.jpg)
Classe OutputStreamWriter
![Page 60: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/60.jpg)
Ecriture d’un caractère à l’écran
![Page 61: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/61.jpg)
Mise en tampon
![Page 62: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/62.jpg)
Classe BufferedReader
![Page 63: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/63.jpg)
Lecture d’une ligne avec tampon
![Page 64: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/64.jpg)
Classe BufferedWriter
![Page 65: Programmation Orienté Objet applications au langage Java Cours « 2 » : Héritage, exception, I/O](https://reader035.vdocuments.mx/reader035/viewer/2022062307/551d9db4497959293b8d954f/html5/thumbnails/65.jpg)
Ecriture d’une ligne avec tampon