What is the correct syntax for a method reference to an instance method of an arbitrary object?

Java Professional Easy

Java Professional — Easy

What is the correct syntax for a method reference to an instance method of an arbitrary object?

Key points

  • Method reference syntax for instance methods: ClassName::methodName
  • Option A, String::length, is the correct syntax for referencing an instance method
  • Options B, C, and D do not follow the correct syntax for method references

Ready to go further?

Related questions