Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ReferenceType2
- {
- class Point
- {
- public int X { get; set; }
- public int Y { get; set; }
- }
- static void Main(string[] args)
- {
- Point p1 = new Point();
- p1.X = 10;
- p1.Y = 5;
- ChangePoint(p1);
- Console.WriteLine("X: {0}, Y:{1}", p1.X, p1.Y);
- }
- static void ChangePoint(Point p)
- {
- p.X = 20;
- p.Y = 10;
- }
- }
- // LECTURE 39 Reference Type Illustrated - 2
- // CS0116 LINE 14 & 24
- // CS0103 LINE 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement