标识符

标识符的注意事项

public class Demon01 {
public static void main(String[] args) {

String Ahello ="";
String hello ="
";
String $hello ="";
String _hello ="
";

/*String 0hello ="";
* String #hello ="
";
* 所有的标识符都应该以字母(A-Z或a-z),美元符($),或者下划线(_)开始 */

String A123 ="";
String aabc ="
";
String _456 ="**";

/String A# ="**";
* String _
="**";
* 首字符之后可以是字母(A-Z或a-z),美元符($),下划线(_)或数字的任意组合*/

String class ="**";
//不能使用关键字作为变量名

String man ="";
String Man ="
";
//标识符大小写是十分敏感的
//可以使用中文取民命但是不建议去这样做,也不建议使用拼音,因为很low,很低级

}
}

posted @ 2021-10-06 21:09  夏凤笙  阅读(65)  评论(0)    收藏  举报