Auf Thema antworten

Das funktioniert nur, wenn du die Variable, der du die Lambda zuweist, als statische Klassenvariable oder Instanzvariable definierst. Z.B. so:

[code=java]

public class Test {

  private final Potenz p = (int x, int y) -> y == 0 ? 1 : x * this.p.potenz(x, y - 1);

}

[/code]



Oben