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

Nullish coalescing operator

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      Proposal for an operator (??) that will return the left side if it is not null, otherwise it'll return the right side.
      For example "Integer someValue = someVariable ?? 1;" In this case if someVariable is null then someValue should be assigned a value of 1. If someVariable is not null, then someValue should be assigned the value of someVariable.


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: