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 ConsoleApplication67
- {
- class Program
- {
- static void Main(string[] args)
- {
- MyClass obj = new MyClass();
- obj.ShowValues();
- MyClass obj2 = new MyClass(15);
- obj2.ShowValues();
- }
- }
- class MyClass
- {
- private int x;
- private int y;
- public MyClass()
- {
- x = 3;
- y = 3;
- }
- public MyClass(int x)
- :this ()
- {
- this.x = x;
- }
- public void ShowValues()
- {
- Console.WriteLine("x = {0}, y = {1}", x, y);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement