Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8233763

RFE: Permit functional interface variables to be directly callable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 14
    • Fix Version/s: None
    • Component/s: specification
    • Labels:

      Description

      A DESCRIPTION OF THE PROBLEM :
      This is a language feature request for Java in general. The idea is to permit calling variables of functional interface types without needing to explicitly include the only non-default interface method.

      With this RFE implemented, the following code would be legal Java:

      Consumer<String> stringConsumer = getConsumer();
      stringConsumer("consume this string");

      today, this could has to be written as:

      stringConsumer.accept("consume this string");


        Attachments

          Activity

            People

            • Assignee:
              smarks Stuart Marks
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: