Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using geom;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("hello");
- Pont p1 = new Pont(4, 5, "fekete");
- //Console.WriteLine("({0}, {1})", p1.x, p1.y);
- //###
- //Console.WriteLine("({0}, {1})", p1.getX(), p1.getY());
- //p1.setX(-3);
- //Console.WriteLine("({0}, {1})", p1.getX(), p1.getY());
- Console.WriteLine("({0}, {1}), {2}", p1.X, p1.Y, p1.Szin);
- p1.X = -3;
- Console.WriteLine("({0}, {1}), {2}", p1.X, p1.Y, p1.Szin);
- }
- }
- }
- ##############
- //pont.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace geom
- {
- class Pont
- {
- private int x, y;
- public int X
- {
- get
- {
- return x;
- }
- set
- {
- x = value;
- }
- }
- public int Y
- {
- get
- {
- return y;
- }
- set
- {
- y = value;
- }
- }
- public string Szin { get; private set; }
- public Pont (int x, int y, string szin)
- {
- this.x = x;
- this.y = y;
- Szin = szin;
- }
- //public int getX()
- //{
- // return x;
- //}
- //public int getY()
- //{
- // return y;
- //}
- //public void setX(int x)
- //{
- // this.x = x;
- //}
- //public void setY(int y)
- //{
- // this.y = y;
- //}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement