Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Trait, trait implementation, default method » ?

Aussi appelé : trait · trait implementation · default method

Definition 8.1 University Computer Science — Year 2 · Chapitre 8 — Traits and Generics

A trait is a named set of method signatures, and possibly of associated types and constants, that a type may provide. A trait implementation, impl Trait for Type { ... }, gives the bodies for one type. A default method is a method whose body is written in the trait itself, in terms of the other methods; an implementation may keep it or replace it.

Lire dans le chapitre →