There are a few characters that are used as separators in java. The mostly commonly used separator in java is the semicolon. As you have seen, it is used to terminate statements.
() called Parentheses used to contain list of parameters in method definition and invocation. Also used for defining precedence expressions in control statements, and cast type.
Braces {} used to contain the values of automatically initialized arrays. Also it is used to define a block of code, for classes, methods, and local scopes.
Brackets [], it is used to declare array types. Also it is used when dereferencing array values.
Comma , it separates consecutive identifiers in a variable declaration. Also it is used to chain statements together inside a for statement.
Period “ .” it is used to separate package names from sub packages and classes. And it is also used to separate a variable or method from a reference variable.
0 Comments:
Post a Comment