<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 關鍵字與操作符 [TOC] ## 硬關鍵字 以下符號會始終解釋為關鍵字,不能用作標識符 * `as` * 用于[類型轉換](http://www.kotlincn.net/docs/reference/typecasts.html#不安全的轉換操作符) * 為[導入指定一個別名](http://www.kotlincn.net/docs/reference/packages.html#導入) * `as?`用于[安全類型轉換](http://www.kotlincn.net/docs/reference/typecasts.html#安全的可空轉換操作符) * `break`[終止循環的執行](http://www.kotlincn.net/docs/reference/returns.html) * `class`聲明一個[類](http://www.kotlincn.net/docs/reference/classes.html) * `continue`[繼續最近層循環的下一步](http://www.kotlincn.net/docs/reference/returns.html) * `do`開始一個[do/while 循環](http://www.kotlincn.net/docs/reference/control-flow.html#while-循環)(后置條件的循環) * `else`定義一個[if 表達式](http://www.kotlincn.net/docs/reference/control-flow.html#if-表達式)條件為 false 時執行的分支 * `false`指定[布爾類型](http://www.kotlincn.net/docs/reference/basic-types.html#布爾)的“假”值 * `for`開始一個[for 循環](http://www.kotlincn.net/docs/reference/control-flow.html#for-循環) * `fun`聲明一個[函數](http://www.kotlincn.net/docs/reference/functions.html) * `if`開始一個[if 表達式](http://www.kotlincn.net/docs/reference/control-flow.html#if-表達式) * `in` * 指定在[for 循環](http://www.kotlincn.net/docs/reference/control-flow.html#for-循環)中迭代的對象 * 用作中綴操作符以檢查一個值屬于[一個區間](http://www.kotlincn.net/docs/reference/ranges.html)、 一個集合或者其他[定義“contains”方法](http://www.kotlincn.net/docs/reference/operator-overloading.html#in)的實體 * 在[when 表達式中](http://www.kotlincn.net/docs/reference/control-flow.html#when-表達式)用于上述目的 * 將一個類型參數標記為[逆變](http://www.kotlincn.net/docs/reference/generics.html#聲明處型變) * `!in` * 用作中綴操作符以檢查一個值**不**屬于[一個區間](http://www.kotlincn.net/docs/reference/ranges.html)、 一個集合或者其他[定義“contains”方法](http://www.kotlincn.net/docs/reference/operator-overloading.html#in)的實體 * 在[when 表達式中](http://www.kotlincn.net/docs/reference/control-flow.html#when-表達式)用于上述目的 * `interface`聲明一個[接口](http://www.kotlincn.net/docs/reference/interfaces.html) * `is` * 檢查[一個值具有指定類型](http://www.kotlincn.net/docs/reference/typecasts.html#is-與-is-操作符) * 在[when 表達式中](http://www.kotlincn.net/docs/reference/control-flow.html#when-表達式)用于上述目的 * `!is` * 檢查[一個值**不**具有指定類型](http://www.kotlincn.net/docs/reference/typecasts.html#is-與-is-操作符) * 在[when 表達式中](http://www.kotlincn.net/docs/reference/control-flow.html#when-表達式)用于上述目的 * `null`是表示不指向任何對象的對象引用的常量 * `object`同時聲明[一個類及其實例](http://www.kotlincn.net/docs/reference/object-declarations.html) * `package`指定[當前文件的包](http://www.kotlincn.net/docs/reference/packages.html) * `return`[從最近層的函數或匿名函數返回](http://www.kotlincn.net/docs/reference/returns.html) * `super` * [引用一個方法或屬性的超類實現](http://www.kotlincn.net/docs/reference/classes.html#調用超類實現) * [在次構造函數中調用超類構造函數](http://www.kotlincn.net/docs/reference/classes.html#繼承) * `this` * 引用[當前接收者](http://www.kotlincn.net/docs/reference/this-expressions.html) * [在次構造函數中調用同一個類的另一個構造函數](http://www.kotlincn.net/docs/reference/classes.html#構造函數) * `throw`[拋出一個異常](http://www.kotlincn.net/docs/reference/exceptions.html) * `true`指定[布爾類型](http://www.kotlincn.net/docs/reference/basic-types.html#布爾)的“真”值 * `try`[開始一個異常處理塊](http://www.kotlincn.net/docs/reference/exceptions.html) * `typealias`聲明一個[類型別名](http://www.kotlincn.net/docs/reference/type-aliases.html) * `val`聲明一個只讀[屬性](http://www.kotlincn.net/docs/reference/properties.html)或[局部變量](http://www.kotlincn.net/docs/reference/basic-syntax.html#定義變量) * `var`聲明一個可變[屬性](http://www.kotlincn.net/docs/reference/properties.html)或[局部變量](http://www.kotlincn.net/docs/reference/basic-syntax.html#定義變量) * `when`開始一個[when 表達式](http://www.kotlincn.net/docs/reference/control-flow.html#when-表達式)(執行其中一個給定分支) * `while`開始一個[while 循環](http://www.kotlincn.net/docs/reference/control-flow.html#while-循環)(前置條件的循環) ## 軟關鍵字 以下符號在適用的上下文中充當關鍵字,而在其他上下文中可用作標識符: * `by` * [將接口的實現委托給另一個對象](http://www.kotlincn.net/docs/reference/delegation.html) * [將屬性訪問器的實現委托給另一個對象](http://www.kotlincn.net/docs/reference/delegated-properties.html) * `catch`開始一個[處理指定異常類型](http://www.kotlincn.net/docs/reference/exceptions.html)的塊 * `constructor`聲明一個[主構造函數或次構造函數](http://www.kotlincn.net/docs/reference/classes.html#構造函數) * `delegate`用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `dynamic`引用一個 Kotlin/JS 代碼中的[動態類型](http://www.kotlincn.net/docs/reference/dynamic-type.html) * `field`用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `file`用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `finally`開始一個[當 try 塊退出時總會執行的塊](http://www.kotlincn.net/docs/reference/exceptions.html) * `get` * 聲明[屬性的 getter](http://www.kotlincn.net/docs/reference/properties.html#getters-與-setters) * 用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `import`[將另一個包中的聲明導入當前文件](http://www.kotlincn.net/docs/reference/packages.html) * `init`開始一個[初始化塊](http://www.kotlincn.net/docs/reference/classes.html#構造函數) * `param`用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `property`用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `receiver`用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `set` * 聲明[屬性的 setter](http://www.kotlincn.net/docs/reference/properties.html#getters-與-setters) * 用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `setparam`用作[注解使用處目標](http://www.kotlincn.net/docs/reference/annotations.html#注解使用處目標) * `where`指定[泛型類型參數的約束](http://www.kotlincn.net/docs/reference/generics.html#上界) ## 修飾符關鍵字 以下符號作為聲明中修飾符列表中的關鍵字,并可用作其他上下文中的標識符: * `actual`表示[多平臺項目](http://www.kotlincn.net/docs/reference/multiplatform.html)中的一個平臺相關實現 * `abstract`將一個類或成員標記為[抽象](http://www.kotlincn.net/docs/reference/classes.html#抽象類) * `annotation`聲明一個[注解類](http://www.kotlincn.net/docs/reference/annotations.html) * `companion`聲明一個[伴生對象](http://www.kotlincn.net/docs/reference/object-declarations.html#伴生對象) * `const`將屬性標記為[編譯期常量](http://www.kotlincn.net/docs/reference/properties.html#編譯期常量) * `crossinline`禁止[傳遞給內聯函數的 lambda 中的非局部返回](http://www.kotlincn.net/docs/reference/inline-functions.html#非局部返回) * `data`指示編譯器[為類生成典型成員](http://www.kotlincn.net/docs/reference/data-classes.html) * `enum`聲明一個[枚舉](http://www.kotlincn.net/docs/reference/enum-classes.html) * `expect`將一個聲明標記為[平臺相關](http://www.kotlincn.net/docs/reference/multiplatform.html),并期待在平臺模塊中實現。 * `external`將一個聲明標記為不是在 Kotlin 中實現(通過[JNI](http://www.kotlincn.net/docs/reference/java-interop.html#在-kotlin-中使用-jni)訪問或者在[JavaScript](http://www.kotlincn.net/docs/reference/js-interop.html#external-修飾符)中實現) * `final`禁止[成員覆蓋](http://www.kotlincn.net/docs/reference/classes.html#覆蓋方法) * `infix`允許以[中綴表示法](http://www.kotlincn.net/docs/reference/functions.html#中綴表示法)調用函數 * `inline`告訴編譯器[在調用處內聯傳給它的函數和 lambda 表達式](http://www.kotlincn.net/docs/reference/inline-functions.html) * `inner`允許在[嵌套類](http://www.kotlincn.net/docs/reference/nested-classes.html)中引用外部類實例 * `internal`將一個聲明標記為[在當前模塊中可見](http://www.kotlincn.net/docs/reference/visibility-modifiers.html) * `lateinit`允許[在構造函數之外初始化非空屬性](http://www.kotlincn.net/docs/reference/properties.html#延遲初始化屬性與變量) * `noinline`關閉[傳給內聯函數的 lambda 表達式的內聯](http://www.kotlincn.net/docs/reference/inline-functions.html#禁用內聯) * `open`允許[一個類子類化或覆蓋成員](http://www.kotlincn.net/docs/reference/classes.html#繼承) * `operator`將一個函數標記為[重載一個操作符或者實現一個約定](http://www.kotlincn.net/docs/reference/operator-overloading.html) * `out`將類型參數標記為[協變](http://www.kotlincn.net/docs/reference/generics.html#聲明處型變) * `override`將一個成員標記為[超類成員的覆蓋](http://www.kotlincn.net/docs/reference/classes.html#覆蓋方法) * `private`將一個聲明標記為[在當前類或文件中可見](http://www.kotlincn.net/docs/reference/visibility-modifiers.html) * `protected`將一個聲明標記為[在當前類及其子類中可見](http://www.kotlincn.net/docs/reference/visibility-modifiers.html) * `public`將一個聲明標記為[在任何地方可見](http://www.kotlincn.net/docs/reference/visibility-modifiers.html) * `reified`將內聯函數的類型參數標記為[在運行時可訪問](http://www.kotlincn.net/docs/reference/inline-functions.html#具體化的類型參數) * `sealed`聲明一個[密封類](http://www.kotlincn.net/docs/reference/sealed-classes.html)(限制子類化的類) * `suspend`將一個函數或 lambda 表達式標記為掛起式(可用做[協程](http://www.kotlincn.net/docs/reference/coroutines.html)) * `tailrec`將一個函數標記為[尾遞歸](http://www.kotlincn.net/docs/reference/functions.html#尾遞歸函數)(允許編譯器將遞歸替換為迭代) * `vararg`允許[一個參數傳入可變數量的參數](http://www.kotlincn.net/docs/reference/functions.html#可變數量的參數varargs) ## 特殊標識符 以下標識符由編譯器在指定上下文中定義,并且可以用作其他上下文中的常規標識符: * `field`用在屬性訪問器內部來引用該[屬性的幕后字段](http://www.kotlincn.net/docs/reference/properties.html#幕后字段) * `it`用在 lambda 表達式內部來[隱式引用其參數](http://www.kotlincn.net/docs/reference/lambdas.html#it單個參數的隱式名稱) ## 操作符和特殊符號 Kotlin 支持以下操作符和特殊符號: * `+`、`-`、`*`、`/`、`%`—— 數學操作符 * `*`也用于[將數組傳遞給 vararg 參數](http://www.kotlincn.net/docs/reference/functions.html#可變數量的參數varargs) * `=` * 賦值操作符 * 也用于指定[參數的默認值](http://www.kotlincn.net/docs/reference/functions.html#默認參數) * `+=`、`-=`、`*=`、`/=`、`%=`——[廣義賦值操作符](http://www.kotlincn.net/docs/reference/operator-overloading.html#assignments) * `++`、`--`——[遞增與遞減操作符](http://www.kotlincn.net/docs/reference/operator-overloading.html#遞增與遞減) * `&&`、`||`、`!`—— 邏輯“與”、“或”、“非”操作符(對于位運算,請使用相應的[中綴函數](http://www.kotlincn.net/docs/reference/basic-types.html#運算)) * `==`、`!=`——[相等操作符](http://www.kotlincn.net/docs/reference/operator-overloading.html#equals)(對于非原生類型會翻譯為調用`equals()`) * `===`、`!==`——[引用相等操作符](http://www.kotlincn.net/docs/reference/equality.html#引用相等) * `<`、`>`、`<=`、`>=`——[比較操作符](http://www.kotlincn.net/docs/reference/operator-overloading.html#comparison)(對于非原生類型會翻譯為調用`compareTo()`) * `[`、`]`——[索引訪問操作符](http://www.kotlincn.net/docs/reference/operator-overloading.html#indexed)(會翻譯為調用`get`與`set`) * `!!`[斷言一個表達式非空](http://www.kotlincn.net/docs/reference/null-safety.html#-操作符) * `?.`執行[安全調用](http://www.kotlincn.net/docs/reference/null-safety.html#安全的調用)(如果接收者非空,就調用一個方法或訪問一個屬性) * `?:`如果左側的值為空,就取右側的值([elvis 操作符](http://www.kotlincn.net/docs/reference/null-safety.html#elvis-操作符)) * `::`創建一個[成員引用](http://www.kotlincn.net/docs/reference/reflection.html#函數引用)或者一個[類引用](http://www.kotlincn.net/docs/reference/reflection.html#類引用) * `..`創建一個[區間](http://www.kotlincn.net/docs/reference/ranges.html) * `:`分隔聲明中的名稱與類型 * `?`將類型標記為[可空](http://www.kotlincn.net/docs/reference/null-safety.html#可空類型與非空類型) * `->` * 分隔[lambda 表達式](http://www.kotlincn.net/docs/reference/lambdas.html#lambda-表達式語法)的參數與主體 * 分隔在[函數類型](http://www.kotlincn.net/docs/reference/lambdas.html#函數類型)中的參數類型與返回類型聲明 * 分隔[when 表達式](http://www.kotlincn.net/docs/reference/control-flow.html#when-表達式)分支的條件與代碼體 * `@` * 引入一個[注解](http://www.kotlincn.net/docs/reference/annotations.html#用法) * 引入或引用一個[循環標簽](http://www.kotlincn.net/docs/reference/returns.html#break-與-continue-標簽) * 引入或引用一個[lambda 表達式標簽](http://www.kotlincn.net/docs/reference/returns.html#標簽處返回) * 引用一個來自外部作用域的[“this”表達式](http://www.kotlincn.net/docs/reference/this-expressions.html#限定的-this) * 引用一個[外部超類](http://www.kotlincn.net/docs/reference/classes.html#調用超類實現) * `;`分隔位于同一行的多個語句 * `$`在[字符串模版](http://www.kotlincn.net/docs/reference/basic-types.html#字符串模板)中引用變量或者表達式 * `_` * 在[lambda 表達式](http://www.kotlincn.net/docs/reference/lambdas.html#下劃線用于未使用的變量自-11-起)中代替未使用的參數 * 在[解構聲明](http://www.kotlincn.net/docs/reference/multi-declarations.html#下劃線用于未使用的變量自-11-起)中代替未使用的參數
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看