W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
標識符是腳本中變量,函數(shù)和標簽的名稱。
Nashorn中的標識符是一個Unicode字符序列,具有以下規(guī)則:
以下是有效標識符的示例:
Id _id e$Id num1
以下是無效標識符:
4num //Cannot start with a digit emp id //Cannot contain spaces emp+id //Cannot contains the + sign break //break is a reserved word and cannot be used as an identifier
Nashorn中保留字的列表用作關鍵字
break do instanceof typeof case else new var catch finally return void continue for switch while debugger function this with default if throw delete in try
Nashorn未來保留詞的列表
class enum extends super const export import
Nashorn未來保留字的列表在嚴格模式
implements let private public yield interface package protected static
Nashorn支持兩種類型的注釋:
在Nashorn中編寫注釋的語法與Java的語法相同。
以下是注釋的示例:
// A single-line comment var Id; /* A multi-line comment */ var et; var d;
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: