Daniel Fisher (lennybacon.com)

SOA, DATA & THE WEB

A class that can be added...

A class that can be added...
public class Point
{
    private int x, y;
    
    public Point(){}

    public Point(int xPos, int yPos){ x = xPos; y = yPos; }

    public static Point operator + (Point p1, Point p2)
    {
       Point newPoint = new Point(p1.x + p2.x, p1.y + p2.y);
       return newPoint;
    }
}
I just wrote that down to have it writen once ;-)

Comments

Write a comment