Lambda expressions eliminate the need for ________.

  • Anonymous inner classes
  • Arrays
  • Inheritance
  • Interfaces
Lambda expressions eliminate the need for anonymous inner classes. Before lambda expressions were introduced in Java, anonymous inner classes were used to implement single-method interfaces, like Runnable or ActionListener. Lambda expressions provide a more concise and expressive way to define such implementations, reducing the verbosity of code.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *