1
0

フィールド値のみを利用するには

Posted at

getterメソッドを用いるとフィールド値のみを取り出す事が出来ます。

アクセス修飾子 フィールドの型 getフィールド名(){
    return this.フィールド名;
 }

この時、フィールド名の最初の文字を大文字にする必要があります。

1
0
1

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