物件導向程式設計

 

 

      2.5 Separators in Java

 

 


授課教師:陳慶瀚

WWW : http://www.miat.ee.isu.edu.tw/java

E-mail : pierre@isu.edu.tw   

 


Separators help define the structure of your program. The separators used in HelloWorld are parentheses, ( ), braces, { }, the period, ., and the semicolon, ;. The table lists the five Java separators (eight if you count opening and closing separators as two).

 
Separator   
( ) Encloses arguments in method definitions and calling; adjusts precedence in arithmetic expressions; surrounds cast types and delimits test expressions in flow control statements
{ } defines blocks of code and automatically initializes arrays
[ ] declares array types and dereferences array values
; terminates statements
, separates successive identifiers in variable declarations; chains statements in the test, expression of a for loop
. Selects a field or method from an object; separates package names from sub-package and class names

  


 

物件導向程式設計

義守大學電機系 陳慶瀚

2001.10.02