Type Inference, Lambda Expression and Method Reference

Hello guys, I am back with a new blog. This blog is an extension of two previous blogs listed below. I would recommend you to go through these blogs before starting with this one.

  • Actual parameter of a method or a constructor (new Thread(lambda) — Thread takes Runnable as an input)
  • The argument of ‘return’ (return lambda)
  • The argument of a cast ((Consumer<String>) lambda)
Capturing lambda (Static field)
Capturing lambda (Non-Static)
  • Instance method, unspecified instance (Employee::getSalary)
  • Instance method, specified instance (mike::getSalary)
  • Constructor (Employee::new)
  • Instance method of the superclass (super::food)
  • Array constructor (A[]::new)