简体   繁体   中英

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.

From what I know, There is Five Types of Tokens

1)Reserve Word or Keywords such as int, public, break, class etc

2)Identifier such as age, sum etc

3)Literals such as 212, 11.5, e2.0 etc.

4)Operators such as +, -, /, * etc.

5)Separators such as $,?,# etc.

However, I am confused at what type of token that 'System.out.println()' in Java is ?

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() is a keyword token as it is reserved in the language. Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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