プロが教える店舗&オフィスのセキュリティ対策術

・JAVA言語的には、import宣言は必須ではない? という理解で合っているでしょうか?
(abstractクラスだからimport宣言が必要とか、そういうことは有り得ない?)

・パッケージ名をその都度書いていけば、仕様的には問題ない?

・実際には、import宣言なしで組んだりすることはないと思うのですが…

A 回答 (1件)

これが該当する説明だと思いますが、


http://docs.oracle.com/javase/specs/jls/se7/html …
| An import declaration allows a named type or a static member to be referred
| to by a simple name (§6.2) that consists of a single identifier.
|
| Without the use of an appropriate import declaration, the only way to refer
| to a type declared in another package, or a static member of another type,
| is to use a fully qualified name (§6.7).

・JAVA言語的には、import宣言は必須ではない? という理解で合っているでしょうか?

あっています。

・パッケージ名をその都度書いていけば、仕様的には問題ない?

そうです。
    • good
    • 0
この回答へのお礼

回答&リンク提示ありがとうございます。
大変参考になりましたー

お礼日時:2013/12/26 07:57

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!