Skip to content

Instantly share code, notes, and snippets.

@sometowngeek
Last active February 24, 2018 18:33
Show Gist options
  • Save sometowngeek/a72dc3acbc1b08105d593f6c6bb6a1ae to your computer and use it in GitHub Desktop.
Save sometowngeek/a72dc3acbc1b08105d593f6c6bb6a1ae to your computer and use it in GitHub Desktop.
Point2.cs for someone on SO
using System;
namespace StackOverflow.Playground
{
public class Point2
{
// This is using the Xcoord as an entity outside of this class.
public static void Main(String[] args)
{
Xcoord xc = new Xcoord();
Console.WriteLine(String.Format("xCoor: {0}; yCoor: {1}", xc.Get_xCoor(), xc.Get_yCoor()));
xc.Set_xCoor(5);
xc.Set_yCoor(6);
Console.WriteLine(String.Format("xCoor: {0}; yCoor: {1}", xc.Get_xCoor(), xc.Get_yCoor()));
Console.ReadKey();
}
}
}
namespace StackOverflow.Playground
{
public class Xcoord
{
public Xcoord()
{
}
private static int xCoor;
private static int yCoor;
public int Get_xCoor()
{
return xCoor;
}
public void Set_xCoor(int value)
{
xCoor = value;
}
public int Get_yCoor()
{
return yCoor;
}
public void Set_yCoor(int value)
{
yCoor = value;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment