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 ConsoleApp19
- {
- class Program
- {
- static void Main(string[] args)
- {
- Person person = new Person();
- Person person1 = new Person("Pesho", 20);
- person.IntroduceYourself();
- person1.IntroduceYourself();
- }
- }
- }
- class Person
- {
- string name;
- int age;
- public Person(string name, int age)
- {
- this.name = name;
- this.age = age;
- }
- public Person()
- {
- this.name = "Icko";
- this.age = 16;
- }
- public void IntroduceYourself()
- {
- Console.WriteLine("I am {0} and i am {1} years old.", this.name, this.age);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement