Monday, May 11, 2015

test2

<?

class Point {
    var x = 0.0 // sets the default value of x to 0
    var y = 0.0 // sets the default value of x to 0
}

// this creates a new Point instance using the default initializer
var point = Point()

point.x = 100 // sets the x property to 100
point.y = 200 // sets the y propery to 200

No comments:

Post a Comment