Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
での作業、Java使用の違いは何ですか
Java
Object[] variableName;
そして使用:
Object variableName[];
コンパイルと実行でまったく同じ効果がありますか? それとも違いはありますか?
ステートメントは同じコードにコンパイルされますが、次のように書くと
Type[] name代わりにType name[]、変数名の前に型 (Array または Not-Array) が常に表示されるため、コードが読みやすくなります。(実際、これはある種の個人的な意味です)
Type[] name
Type name[]