Separators in Java - Explained
Separators in Java - Explained
By Naomi A.
Hello reader - Here, I am sharing the characters that are used as separators in Java, and explaining them for better understanding.
__________________________________________________________________________________
What is a separator?
- A separator is a character or a sequence of characters that separates tokens in a program.
What is a token?
- A token is a sequence of characters that are used to represent various elements of the code in a Java program - keywords, identifiers, literals, and punctuation.
Whitespace Is not considered a separator:
- Because Java is a free-form language, you don't need to abide by any indentation or spacing rules. Whitespace includes; spaces, tabs, and newline characters.
- This improves readability for the developer but is ignored by the compiler.
__________________________________________________________________________________
Separators in Java:
Comma:/
) is used as the division operator and to create comments in Java code.__________________________________________________________________________________
Thanks for reading!
Separators play a vital role in the structure and syntax of the language. Stay tuned techies; for more posts on Java.
Comments