"safe navigation operator" meaning in English

See safe navigation operator in All languages combined, or Wiktionary

Noun

Forms: safe navigation operators [plural]
Head templates: {{en-noun}} safe navigation operator (plural safe navigation operators)
  1. (programming) A binary operator that returns its second argument, unless the first argument is null, in which case it returns null; used to simplify code that would otherwise need multiple explicit checks for nullity. Wikipedia link: safe navigation operator Categories (topical): Programming
    Sense id: en-safe_navigation_operator-en-noun-5huQazUy Categories (other): English entries with incorrect language header Topics: computing, engineering, mathematics, natural-sciences, physical-sciences, programming, sciences

Inflected forms

Download JSON data for safe navigation operator meaning in English (2.4kB)

{
  "forms": [
    {
      "form": "safe navigation operators",
      "tags": [
        "plural"
      ]
    }
  ],
  "head_templates": [
    {
      "args": {},
      "expansion": "safe navigation operator (plural safe navigation operators)",
      "name": "en-noun"
    }
  ],
  "lang": "English",
  "lang_code": "en",
  "pos": "noun",
  "senses": [
    {
      "categories": [
        {
          "kind": "other",
          "name": "English entries with incorrect language header",
          "parents": [
            "Entries with incorrect language header",
            "Entry maintenance"
          ],
          "source": "w"
        },
        {
          "kind": "topical",
          "langcode": "en",
          "name": "Programming",
          "orig": "en:Programming",
          "parents": [
            "Computing",
            "Software engineering",
            "Technology",
            "Computer science",
            "Engineering",
            "Software",
            "All topics",
            "Sciences",
            "Applied sciences",
            "Media",
            "Fundamental",
            "Communication"
          ],
          "source": "w"
        }
      ],
      "examples": [
        {
          "ref": "2009, Bashar Jawad, Groovy and Grails Recipes, page 57",
          "text": "One operator I haven't talked about yet is the safe navigation operator (?.). By preceding a dot with a question mark, you can safely navigate to methods or properties of an object even if that object is null.",
          "type": "quotation"
        },
        {
          "ref": "2015, Mert Caliskan, Kenan Sevindik, Beginning Spring, page 278",
          "text": "The safe navigation operator (?.) provides navigation on the nested properties without getting any exception when a null value is evaluated from any of the properties iterated.",
          "type": "quotation"
        },
        {
          "ref": "2017, Gary McLean Hall, Adaptive Code: Agile coding with design patterns and SOLID principles",
          "text": "C# 6 introduced a cascading nulls operator, also called the null-conditional operator and the safe navigation operator.",
          "type": "quotation"
        }
      ],
      "glosses": [
        "A binary operator that returns its second argument, unless the first argument is null, in which case it returns null; used to simplify code that would otherwise need multiple explicit checks for nullity."
      ],
      "id": "en-safe_navigation_operator-en-noun-5huQazUy",
      "links": [
        [
          "programming",
          "programming#Noun"
        ],
        [
          "binary",
          "binary"
        ],
        [
          "operator",
          "operator"
        ],
        [
          "return",
          "return"
        ],
        [
          "argument",
          "argument"
        ],
        [
          "null",
          "null"
        ]
      ],
      "raw_glosses": [
        "(programming) A binary operator that returns its second argument, unless the first argument is null, in which case it returns null; used to simplify code that would otherwise need multiple explicit checks for nullity."
      ],
      "topics": [
        "computing",
        "engineering",
        "mathematics",
        "natural-sciences",
        "physical-sciences",
        "programming",
        "sciences"
      ],
      "wikipedia": [
        "safe navigation operator"
      ]
    }
  ],
  "word": "safe navigation operator"
}
{
  "forms": [
    {
      "form": "safe navigation operators",
      "tags": [
        "plural"
      ]
    }
  ],
  "head_templates": [
    {
      "args": {},
      "expansion": "safe navigation operator (plural safe navigation operators)",
      "name": "en-noun"
    }
  ],
  "lang": "English",
  "lang_code": "en",
  "pos": "noun",
  "senses": [
    {
      "categories": [
        "English countable nouns",
        "English entries with incorrect language header",
        "English lemmas",
        "English multiword terms",
        "English nouns",
        "English terms with quotations",
        "Quotation templates to be cleaned",
        "en:Programming"
      ],
      "examples": [
        {
          "ref": "2009, Bashar Jawad, Groovy and Grails Recipes, page 57",
          "text": "One operator I haven't talked about yet is the safe navigation operator (?.). By preceding a dot with a question mark, you can safely navigate to methods or properties of an object even if that object is null.",
          "type": "quotation"
        },
        {
          "ref": "2015, Mert Caliskan, Kenan Sevindik, Beginning Spring, page 278",
          "text": "The safe navigation operator (?.) provides navigation on the nested properties without getting any exception when a null value is evaluated from any of the properties iterated.",
          "type": "quotation"
        },
        {
          "ref": "2017, Gary McLean Hall, Adaptive Code: Agile coding with design patterns and SOLID principles",
          "text": "C# 6 introduced a cascading nulls operator, also called the null-conditional operator and the safe navigation operator.",
          "type": "quotation"
        }
      ],
      "glosses": [
        "A binary operator that returns its second argument, unless the first argument is null, in which case it returns null; used to simplify code that would otherwise need multiple explicit checks for nullity."
      ],
      "links": [
        [
          "programming",
          "programming#Noun"
        ],
        [
          "binary",
          "binary"
        ],
        [
          "operator",
          "operator"
        ],
        [
          "return",
          "return"
        ],
        [
          "argument",
          "argument"
        ],
        [
          "null",
          "null"
        ]
      ],
      "raw_glosses": [
        "(programming) A binary operator that returns its second argument, unless the first argument is null, in which case it returns null; used to simplify code that would otherwise need multiple explicit checks for nullity."
      ],
      "topics": [
        "computing",
        "engineering",
        "mathematics",
        "natural-sciences",
        "physical-sciences",
        "programming",
        "sciences"
      ],
      "wikipedia": [
        "safe navigation operator"
      ]
    }
  ],
  "word": "safe navigation operator"
}

This page is a part of the kaikki.org machine-readable English dictionary. This dictionary is based on structured data extracted on 2024-05-15 from the enwiktionary dump dated 2024-05-02 using wiktextract (8203a16 and 304864d). The data shown on this site has been post-processed and various details (e.g., extra categories) removed, some information disambiguated, and additional data merged from other sources. See the raw data download page for the unprocessed wiktextract data.

If you use this data in academic research, please cite Tatu Ylonen: Wiktextract: Wiktionary as Machine-Readable Structured Data, Proceedings of the 13th Conference on Language Resources and Evaluation (LREC), pp. 1317-1325, Marseille, 20-25 June 2022. Linking to the relevant page(s) under https://kaikki.org would also be greatly appreciated.