IntelliJ IDEA Tips & Tricks #39: Auto-refactor anonymous inner class with lambda

preview_player
Показать описание
Say you want to create a Thread by overriding the run() method in the Runnable interface in the form of an anonymous inner class. Runnable is an "functional interface" because it has only one abstract method. Hence, you can auto-refactor the anonymous inner class with an equivalent lambda. The resulting code is much more concise and readable. Try it now!
Рекомендации по теме