1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

module-info.javaの書き方

Last updated at Posted at 2021-10-12

#module-info.javaの書き方

##問題点と解決策
モジュールの名前に、パッケージと同じ(またはほぼ同じ)名前を付けた例が散見された。
間違いではないが非常に紛らわしく混乱した。
どこにどのレベルの名称を書くのか、構文レベルで事前把握しておくが吉。

ModuleDeclaration
{Annotation} [open] module Identifier {. Identifier} { {ModuleDirective} }
ModuleDirective
requires {RequiresModifier} ModuleName ;
exports PackageName [to ModuleName {, ModuleName}] ;
opens PackageName [to ModuleName {, ModuleName}] ;
uses TypeName ;
provides TypeName with TypeName {, TypeName} ;
RequiresModifier
(one of)
transitive static
提供側 単位 利用側 単位
exports パッケージ requires モジュール
opens パッケージ -
provides タイプ uses タイプ
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?