Simad | Tutoriel JAVA8 N°8: Type Inference Java 8 @simad2288 | Uploaded July 2018 | Updated October 2024, 12 hours ago.
L'inférence de type est la capacité d'un compilateur Java à examiner chaque invocation de méthode et la déclaration correspondante pour déterminer l'argument de type (ou les arguments) qui rendent l'invocation applicable. L'algorithme d'inférence détermine les types d'arguments et, le cas échéant, le type auquel le résultat est affecté ou renvoyé. Enfin, l'algorithme d'inférence essaie de trouver le type le plus spécifique qui fonctionne avec tous les arguments.
L'inférence de type est la capacité d'un compilateur Java à examiner chaque invocation de méthode et la déclaration correspondante pour déterminer l'argument de type (ou les arguments) qui rendent l'invocation applicable. L'algorithme d'inférence détermine les types d'arguments et, le cas échéant, le type auquel le résultat est affecté ou renvoyé. Enfin, l'algorithme d'inférence essaie de trouver le type le plus spécifique qui fonctionne avec tous les arguments.