Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main ( string [] args )
- {
- Person b = new Person ( "Abdulla", 155, PersonBehavior.agressive );
- Console.WriteLine ( b.ShowBehavior () );
- }
- public enum PersonBehavior
- {
- agressive, passive, polite
- }
- class Person
- {
- public string Name;
- public int Age;
- PersonBehavior Behavior;
- public Person ( string name, int age, PersonBehavior behavior )
- {
- Name = name;
- Age = age;
- Behavior = behavior;
- }
- public Person ( string name, int age )
- {
- }
- public PersonBehavior ShowBehavior ()
- {
- return Behavior;
- }
- }
- class Employee : Person
- {
- protected float Salary;
- public Employee ( string name, int age, float salary ) : base ( name, age )
- {
- Name = name;
- Age = age;
- Salary = salary;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement