Campbell wrote:Please look at ActionListener and work out why it is a Functional Interface, even though it isn't flagged with that annotation. Hint: you do it by counting methods. Then go to the Java™ Tutorials and find out how I converted the body of the addActionListener() call to a λ expression.
Campbell Ritchie wrote:Did that code run? It ought to. You simply need to feed SimpleGui3.main(null); to JShell.
Campbell wrote:Optional. It is possible to call Foo.main(null); on JShell, but that is easier if you declare it as public static void main(String... args). You can then write Foo.main();