salut,
dans le livre Java 8 Lambdas, ya un mot anglais qui est intraduisible, voici le bloc :
Anonymous inner classes were designed to make it easier for Java programmers to pass
around code as data. Unfortunately, they don’t make it easy enough. There are still four
lines of boilerplate code required in order to call the single line of important logic. Look
how much gray we get if we color out the boilerplate:
Boilerplate isn’t the only issue, though: this code is fairly hard to read because it obscures
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { System.out.println("button clicked"); } });
the programmer’s intent. We don’t want to pass in an object; what we really want to do
is pass in some behavior. In Java 8, we would write this code example as a lambda
expression, as shown in Example 2-2.
comment traduire ce mot, par quoi ?
merci
Partager