当前位置:网站首页>Kotlin keyword and operator
Kotlin keyword and operator
2022-06-25 09:52:00 【seevc】
And Java contrast , take kotlin Unique keywords come first .
Hard keywords
| keyword | meaning |
|---|---|
| val | Declare a read-only variable |
| var | Declare a variable |
| when | Start a when expression , similar Java Medium switch |
| as | For type conversion ; Specify an alias for the import |
| as? | Used for safe type conversion |
| fun | Declare a function |
| in | 1. Appoint for Objects iterated in the loop ;2. As infix operator , Detect the interval of a value ;3. Mark a type parameter as inverse |
| !in | 1. Use as infix expression , Detect that a value does not belong to an interval |
| is | Detect that a variable is of a specified type |
| !is | Detect that a variable is not of the specified type |
| typealias | Declare a type alias |
| interface | Declare an interface |
| break | Terminate the execution of the loop |
| class | Declare a class |
| continue | Continue to the next cycle |
| do | Post conditional loop ,do/while Use a combination of |
| else | A definition of if The branch taken when the expression does not satisfy the condition |
| false | Boolean type “ false ” value |
| for | Start a for loop |
| if | Start a if expression |
| null | Is a constant that represents an object reference that does not point to any object |
| object | Declare a class and its instances at the same time , |
| package | Specifies the package of the current file |
| return | Return from the nearest layer function or anonymous function |
| super | Methods that reference the parent class ; The constructor of the parent class is called in the constructor |
| this | 1. Reference the current recipient ;2. Call another constructor in the constructor |
| throw | Throw an exception |
| try | Start an exception handling block |
| while | Start a while loop |
Soft keywords
The following symbols act as keywords in the applicable context , It can be used as an identifier in other contexts :
| keyword | meaning |
|---|---|
| by | agent , Delegate the implementation of the interface to another object ; Delegate the implementation of the property accessor to another object |
| constructor | Declare a constructor , When there are multiple constructors, you will use |
| delegate | Used as the target of annotation |
| dynamic | Refer to a Kotlin/JS Dynamic types in code |
| init | Start an initialization code block |
| where | Specify constraints for generic type parameters |
| field | Use in comments |
| file | Used as an annotation |
| finally | try A block that is always executed when a statement block exits |
| get | 1. Declaring the property getter;2. Use in comments |
| set | 1. Declaring the property setter;2. Use in comments |
| import | Import the declaration from another package into the current file |
边栏推荐
- Wechat official account can reply messages normally, but it still prompts that the service provided by the official account has failed. Please try again later
- 使用EVO
- CyCa children's physical etiquette Yueqing City training results assessment successfully concluded
- Armbian version name comparison
- Pytorch_ Geometric (pyg) uses dataloader to report an error runtimeerror: sizes of tenants must match except in dimension 0
- SQL advanced
- Use Navicat to compare data differences and structure differences of multi environment databases, and automatic DML and DDL scripts
- Wearable devices may reveal personal privacy
- 2台三菱PLC走BCNetTCP协议,能否实现网口无线通讯?
- 处理图片类库
猜你喜欢
![[matlab] image binarization (imbinarize function)](/img/3e/066f460d9f436bbc43ea35e46093e2.jpg)
[matlab] image binarization (imbinarize function)

Mengyou Technology: six elements of tiktok's home page decoration, how to break ten thousand dollars in three days

Can two Mitsubishi PLC adopt bcnettcp protocol to realize wireless communication of network interface?

CyCa children's physical etiquette Yueqing City training results assessment successfully concluded

How to "transform" small and micro businesses (I)?

Tiktok brand goes to sea: both exposure and transformation are required. What are the skills of information flow advertising?

How much money have I made by sticking to fixed investment for 3 years?

Encoding format for x86

Analysis on the thinking of 2022 meisai C question

Flutter dialog: cupertinoalertdialog
随机推荐
Cocopod error failed: undefined method `map 'for nil:nilclass
Shuttle JSON, list, map inter transfer
Nano data World Cup data interface, CSL data, sports data score, world cup schedule API, real-time data interface of football match
Neat Syntax Design of an ETL Language (Part 2)
Download the arm64 package of Debian on X86 computer
2台三菱PLC走BCNetTCP协议,能否实现网口无线通讯?
[Ruby on rails full stack course] course directory
Creating a binary tree (binary linked list) from a generalized table
CYCA 2022少儿形体礼仪初级师资班 深圳总部站圆满结束
Rxjs TakeUntil 操作符的学习笔记
Etcd tutorial - Chapter 4 etcd cluster security configuration
Data-driven anomaly detection and early warning of 21 May Day C
Analysis on the thinking of 2022 meisai C question
字符串 最长公共前缀
[buuctf.reverse] 117-120
Fluent: target support file /pods runner / pods runner frameworks Sh: permission denied - stack overflow
Cubemx stm32f105rb USB flash drive reading and writing detailed tutorial
Applet cloud development joint table data query and application in cloud function
Learning notes of rxjs takeuntil operator
8、智慧交通项目(1)