V2EX  ›  英汉词典
Enqueued related words: Nonoptional

Non-nullable

Definition / 释义

non-nullable(不可为 null 的;不允许为空的):常用于编程语境,指某个变量、字段、类型或数据库列**不允许取值为 null**,必须始终有一个有效值(或以其他方式表示“没有值”,如空字符串、空集合、Optional/Maybe 等)。

Examples / 例句

The name field is non-nullable, so you must provide a value.
name 字段是不可为 null 的,所以你必须提供一个值。

In Kotlin, a non-nullable type like String cannot be assigned null without using String?.
在 Kotlin 中,像 String 这样的不可为 null 类型不能被赋值为 null,除非使用 String?

Pronunciation / 发音

/ˌnɒn ˈnʌləbl/ (BrE); /ˌnɑːn ˈnʌləbl/ (AmE)

Etymology / 词源

由前缀 non-(表示“非、不”)+ nullable 构成;nullable 来自 null(“空值、无效值”)+ 后缀 -able(“能够……的”)。合起来字面意思是“不能成为空值的”。

Related Words / 相关词

In Literature / 文学与作品

  • Kotlin in Action(《Kotlin 实战》):讨论 Kotlin 的可空类型与不可空(non-nullable)类型系统设计。
  • C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development:介绍 C# 的 nullable reference types 与 non-nullable 约束与警告机制。
  • Effective TypeScript:涉及 TypeScript 中 null/undefined 的处理与“非空”类型表达(与 non-nullable 概念密切相关)。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1066 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 17:35 · PVG 01:35 · LAX 09:35 · JFK 12:35
♥ Do have faith in what you're doing.