简体   繁体   English

System.out.println()在Java中是哪种类型的令牌?

[英]What type of token that system.out.println() is in Java?

I have a homework problem that asks me to show the full sequence of tokens in a Java program. 我有一个作业问题,要求我在Java程序中显示令牌的完整序列。

From what I know, There is Five Types of Tokens 据我所知,代币有五种类型

1)Reserve Word or Keywords such as int, public, break, class etc 1)保留单词或关键字,例如int,public,break,class等

2)Identifier such as age, sum etc 2)年龄,金额等标识符

3)Literals such as 212, 11.5, e2.0 etc. 3)212、11.5,e2.0等文学

4)Operators such as +, -, /, * etc. 4)运算符,例如+,-,/,*等

5)Separators such as $,?,# etc. 5)分隔符,例如$,?,#等

However, I am confused at what type of token that 'System.out.println()' in Java is ? 但是,我对Java中的'System.out.println()'是什么类型的令牌感到困惑?

Thanks for any help. 谢谢你的帮助。

Let's break it down: 让我们分解一下:

System    // Identifier (class)
.         // Separator
out       // Identifier (variable)
.         // Seperator
println() // Identifier (method)

Identifiers with separators between them. 标识符之间使用分隔符。

I think. 我认为。

System, out and println are identifiers, All the rest are separators. System,out和println是标识符,其余所有都是分隔符。

System.out.println() is a keyword token as it is reserved in the language. System.out.println()是关键字标记,因为它是该语言的保留字。 Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM