Java (langage)Java est un langage de programmation de haut niveau orienté objet créé par James Gosling et Patrick Naughton, employés de Sun Microsystems, avec le soutien de Bill Joy (cofondateur de Sun Microsystems en 1982), présenté officiellement le au SunWorld. La société Sun est rachetée en 2009 par la société Oracle qui détient et maintient désormais Java. Un logiciel écrit en language Java a pour particularité d'être compilé vers un code intermédiaire formé de bytecodes qui peut être exécutée dans une machine virtuelle Java (JVM) en faisant abstraction du système d'exploitation.
Java (technique)Java est une technique informatique développée initialement par Sun Microsystems puis acquise par Oracle à la suite du rachat de l'entreprise. Défini à l'origine comme un langage de programmation, Java a évolué pour devenir un ensemble cohérent d'éléments techniques et non techniques.
Java syntaxThe syntax of Java is the set of rules defining how a Java program is written and interpreted. The syntax is mostly derived from C and C++. Unlike in C++, in Java there are no global functions or variables, but there are data members which are also regarded as global variables. All code belongs to classes and all values are objects. The only exception is the primitive types, which are not represented by a class instance for performance reasons (though can be automatically converted to objects and vice versa via autoboxing).
Java version historyThe Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java language has been governed by the Java Community Process (JCP), which uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The language is specified by the Java Language Specification (JLS); changes to the JLS are managed under JSR 901.
Héritage (informatique)En programmation orientée objet, l’héritage est un mécanisme qui permet, lors de la déclaration d’une nouvelle classe, d'y inclure les caractéristiques d’une autre classe. L'héritage établit une relation de généralisation-spécialisation qui permet d'hériter dans la déclaration d’une nouvelle classe (appelée classe dérivée, classe fille, classe enfant ou sous-classe) des caractéristiques (propriétés et méthodes) de la déclaration d'une autre classe (appelée classe de base, classe mère, classe parent ou super-classe).
Applet JavaUn applet Java est un applet, fournie aux utilisateurs sous la forme de bytecode Java. Un applet Java peut fonctionner dans un navigateur web, grâce à une machine virtuelle Java (JVM), ou dans l'AppletViewer de Sun, un outil permettant de tester les applets Java. Les applets Java ont été introduits dans la première version du langage, de 1995. Les applets Java sont la plupart du temps écrits en langage Java, mais ils peuvent également être écrits dans n'importe quel langage qui se compile en bytecode, comme Jython, Groovy ou encore Scala.
Machine virtuelle Javavignette|Machine virtuelle Java - Spécification Java 7 La machine virtuelle Java (en anglais Java virtual machine, abr. JVM) est un appareil informatique fictif qui exécute des programmes compilés sous forme de bytecode Java. L'appareil est simulé par un logiciel spécifique à chaque plateforme ou couple (machine/système d’exploitation) et permet aux applications Java compilées en bytecode de produire les mêmes résultats quelle que soit la plate-forme, tant que celle-ci est pourvue de la machine virtuelle Java adéquate.
Bytecode JavaLe bytecode Java est un bytecode destiné à regrouper des instructions exécutables par une machine virtuelle Java. Par extension, il désigne un flux d'octets binaire au format d'une classe Java. Ce flux est habituellement le résultat de la compilation d'un code source, ce code source n'étant pas obligatoirement écrit en langage Java. Ce bytecode peut être exécuté sous de nombreux systèmes d'exploitation par une machine virtuelle Java.
Programmation orientée objetLa programmation orientée objet (POO), ou programmation par objet, est un paradigme de programmation informatique. Elle consiste en la définition et l'interaction de briques logicielles appelées objets ; un objet représente un concept, une idée ou toute entité du monde physique, comme une voiture, une personne ou encore une page d'un livre. Il possède une structure interne et un comportement, et il sait interagir avec ses pairs.
Méthode (informatique)En programmation orientée objet (POO), une méthode est une routine membre d'une classe. Une méthode peut être: une méthode d'instance, n'agissant que sur un seul objet (instance de la classe) à la fois; une méthode statique ou méthode de classe, indépendante de toute instance de la classe (objet). En programmation orientée objet, on utilise parfois le terme spécifique d'invocation de méthode pour désigner l'appel d'une telle fonction d'une classe.
Interface (programmation orientée objet)En programmation orientée objet, une interface est un ensemble de signatures de méthodes publiques d'un objet. Il s'agit donc d'un ensemble de méthodes accessibles depuis l'extérieur d'une classe, par lesquelles on peut modifier un objet, ou plus généralement communiquer avec lui. Pour rappel, la différenciation entre méthodes publiques et méthodes privées introduit une abstraction qui : empêche le programmeur d'application (qui emploie une classe) de manipuler l'objet de façon indue, puisque les seules modifications possibles d'une instance sont celles indiquées comme publiques par le concepteur de la classe ; permet au programmeur de la classe, de modifier l'implémentation interne de ces méthodes de manière transparente.
Parametric polymorphismIn programming languages and type theory, parametric polymorphism allows a single piece of code to be given a "generic" type, using variables in place of actual types, and then instantiated with particular types as needed. Parametrically polymorphic functions and data types are sometimes called generic functions and generic datatypes, respectively, and they form the basis of generic programming. Parametric polymorphism may be contrasted with ad hoc polymorphism.
Polymorphisme (informatique)En informatique et en théorie des types, le polymorphisme, du grec ancien polús (plusieurs) et morphê (forme), est le concept consistant à fournir une interface unique à des entités pouvant avoir différents types. Par exemple, des opérations telles que la multiplication peuvent ainsi être étendues à des scalaires aux vecteurs ou aux matrices, l'addition, des scalaires aux fonctions ou aux chaînes de caractères, etc.
Object-oriented designObject-oriented design (OOD) is the process of planning a system of interacting objects for the purpose of solving a software problem. It is one approach to software design. An object contains encapsulated data and procedures grouped together to represent an entity. The 'object interface' defines how the object can be interacted with. An object-oriented program is described by the interaction of these objects. Object-oriented design is the discipline of defining the objects and their interactions to solve a problem that was identified and documented during object-oriented analysis.
Virtual method tableIn computer programming, a virtual method table (VMT), virtual function table, virtual call table, dispatch table, vtable, or vftable is a mechanism used in a programming language to support dynamic dispatch (or run-time method binding). Whenever a class defines a virtual function (or method), most compilers add a hidden member variable to the class that points to an array of pointers to (virtual) functions called the virtual method table.
Late bindingIn computing, late binding or dynamic linkage—though not an identical process to dynamically linking imported code libraries—is a computer programming mechanism in which the method being called upon an object, or the function being called with arguments, is looked up by name at runtime. In other words, a name is associated with a particular operation or object at runtime, rather than during compilation. The name dynamic binding is sometimes used, but is more commonly used to refer to dynamic scope.
Name bindingIn programming languages, name binding is the association of entities (data and/or code) with identifiers. An identifier bound to an object is said to reference that object. Machine languages have no built-in notion of identifiers, but name-object bindings as a service and notation for the programmer is implemented by programming languages. Binding is intimately connected with scoping, as scope determines which names bind to which objects – at which locations in the program code (lexically) and in which one of the possible execution paths (temporally).
Objet (informatique)En informatique, un objet est un conteneur symbolique et autonome qui contient des informations et des mécanismes concernant un sujet, manipulés dans un programme. Le sujet est souvent quelque chose de tangible appartenant au monde réel. C'est le concept central de la programmation orientée objet (POO). En programmation orientée objet, un objet est créé à partir d'un modèle appelé classe ou prototype, dont il hérite les comportements et les caractéristiques.
Ad hoc polymorphismIn programming languages, ad hoc polymorphism is a kind of polymorphism in which polymorphic functions can be applied to arguments of different types, because a polymorphic function can denote a number of distinct and potentially heterogeneous implementations depending on the type of argument(s) to which it is applied. When applied to object-oriented or procedural concepts, it is also known as function overloading or operator overloading.
Covariance and contravariance (computer science)Many programming language type systems support subtyping. For instance, if the type is a subtype of , then an expression of type should be substitutable wherever an expression of type is used. Variance is how subtyping between more complex types relates to subtyping between their components. For example, how should a list of s relate to a list of s? Or how should a function that returns relate to a function that returns ? Depending on the variance of the type constructor, the subtyping relation of the simple types may be either preserved, reversed, or ignored for the respective complex types.