LoginSignup
0
2

More than 3 years have passed since last update.

【Java】アクセス修飾子

Last updated at Posted at 2020-11-23

アクセス修飾子

修飾子とは

変数名、関数名の前に付与する単語 のこと。

アクセス修飾子とは

*「クラスや変数がどこからアクセス可能であるか」 *の公開範囲 を決定するための修飾子です。

アクセス修飾子の種類

こちらがアクセス修飾子種類と内容です。
以下の表では下に行くほどアクセスの条件が厳しくなっていきます。

アクセス修飾子 内容
public すべてのクラスからアクセスできる
protected 現在のクラスとサブクラスからアクセスできる
なし 現在のクラスと同じパッケージのクラスからアクセスできる
private 現在のクラスからだけアクセスできる
0
2
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
0
2