0
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?

Java解説 20250427

Posted at

アクセス修飾子

  • クラス、コンストラクタ、変数、メソッドに対し、他のクラスへのアクセス公開範囲を制限するもの。
  • コードの先頭に記述されている。
アクセス修飾子 概要
public すべてのクラスからアクセスできる
protected 現在のクラスとサブクラスからアクセスできる
なし 現在のクラスと同じパッケージのクラスからアクセスできる
private 現在のクラスからだけアクセスできる

継承

  • サブクラスを定義するには、「extends」を使用する。
  • javaは単一継承の為、「extends」の後に指定できるクラスは1つのみ。

オーバーライド

スーパークラスで定義されたメソッドをサブクラスで再定義することである。

スーパークラス

継承元となるクラス。


オラクル認定資格教科書 Javaプログラマ Bronze SE(試験番号1Z0-818)

0
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
0
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?