Last active
February 24, 2018 18:33
-
-
Save sometowngeek/a72dc3acbc1b08105d593f6c6bb6a1ae to your computer and use it in GitHub Desktop.
Point2.cs for someone on SO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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