Programmation Orientée Objet
Java
Abdelhak Mahmoudi
ENS-Rabat
Histoire
• 1990: Projet Oak à Sun Microsystems Inc.
• 1994: Boom Internet
• 1995: Oak renommé Java
• 1995: Netscape adopte java, et crée Javascript
• 1997: HotJava premier navigateur écrit en Java
• 1996-1998: JDK
• 1998-2006: J2SE
• 2006: Java SE
• 2007: sortie de Android, utilisant Java
• 2009: Acquisition par Oracle
• 2014: JavaFX
• 2016: Applets abandonnées
Développement Web
Développement Web
• 1990: Projet Oak à Sun Microsystems Inc.
• 1994: Boom Internet
• 1995: Oak renommé Java
• 1997: HotJava (premier navigateur écrit en Java)
et Netscape adopte java Applets
• 1996-1998: JDK
• 1998-2006: J2SE
• 2006: Java SE
• 2014: JavaFX
• 2016: Applets abandonnées
Développement Web
• 1990: Projet Oak à Sun Microsystems Inc.
• 1994: Boom Internet
• 1995: Oak renommé Java
• 1997: HotJava (premier navigateur écrit en Java)
et Netscape adopte java Applets
• 1996-1998: JDK
• 1998-2006: J2SE
• 2006: Java SE
• 2014: JavaFX
• 2016: Applets abandonnées
Environnement
• JDK : Java Devlopement Kits
• JRE: Java Runtime Edition (Library + JVM (Java Virtual Machine))
• JSR: Java Specification Requests
Java est…
• Portable: indépendance de la plateforme
• Robuste: Gestion automatique de la mémoire (Garbage
Collection)
• Multi-Tache: Gestion simultanée de plusieurs processus
• Orienté Objet: Notion d’Objet, Classe, Polymorphisme,
Héritage, Abstraction, Encapsulation
• Dynamique et Extensible: Classes utilisées selon le besoin
• Sécurisé: le programme s’exécute à l’intérieur de la JVM
• Distribué: Conçu pour une architecture Client-Serveur
Portabilité
Stdio.o
Compilation
Compilateur
Prog.c Prog.o Linker [Link]
(gcc)
Stdlib.o
[Link]
Compilation interprétation
Compilateur [Link] [Link] JVM
[Link] Linker [Link]
(javac) (bytecode) (Prog.o) (java)
[Link] Write once,
Run anywhere
Premier Programme
[Link]
public class Hello {
public static void main(String[] args) {
[Link]("Salut");
}
}
Exécution
Ligne de commande Eclipse
$ javac [Link]
$ java Hello
Salut