Initializing a property in c#

Posted by Shonna on Stack Overflow See other posts from Stack Overflow or by Shonna
Published on 2010-04-01T00:04:57Z Indexed on 2010/04/01 0:13 UTC
Read the original article Hit count: 710

Filed under:
|
|

I have a constructor I am trying to build with the header public KsuPoint(double x0, double y0)

now i also have properties in the class as shown below

private double x;

    public double X
    {
        get { return x; }

    }

    private double y;

    public double Y
    {
        get { return y; }

    }

This constructor is suppose to initialize the properties X and Y ...

is this correct? or am i off?

public KsuPoint(double x0, double y0)
    {
        new KsuPoint(x0, y0);
    }

© Stack Overflow or respective owner

Related posts about c#

Related posts about CSharp