クラスの定義
package packageName;
import ClassNameToImport;
accessSpecifier class ClassName {
accessSpecifier dataType variableName [= initialValue];
accessSpecifier ClassName([argumentList]) {
constructorStatements
}
acccessSpecifier returnType methoName ([argumentList]) {
methodStatements
}
// This is a comment
/* This is a comment too */
/* This is a
multiline
comment */
}
コメント
// This is a comment
/* This is a comment too */
/* This is a
multiline
comment */
パッケージ
名前空間を提供するためのもので、その内部ではすべての名前が位置である領域を示す
package orgType.orgName.appName.compName;
import文
参照するクラスが配置されている場所を示す。
import ClassNameToImport;