1
1

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 5 years have passed since last update.

csharp > プロパティ > private re; public double Re {...} > 命名規則?

Last updated at Posted at 2015-07-23

上記に以下のようなコード例があった。

class Complex
{
    // 実装は外部から隠蔽(privateにしておく)
    private double re; // 実部を記憶しておく

    // 実部の取得・変更用のプロパティ
    public double Re
    {
        set { this.re = value; }
        get { return this.re; }
    }
    ... 

reというprivate変数に対して、プロパティRe()を用意してる。

他のサイトでも同じように小文字のprivate変数(name)に対して先頭大文字のプロパティ名(Name())の例があった。
http://qiita.com/shell/items/1908decb889ad60fb8d2

こういう命名規則があるのだろうか? それは一般的なのだろうか?

1
1
2

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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?