Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Car car;
- car = new Car("Red");
- Console.WriteLine(car.Describe());
- car = new Car("Green");
- Console.WriteLine(car.Describe());
- Console.ReadLine();
- }
- }
- class Car
- {
- private string color;
- public Car(string color)
- {
- this.color = color;
- }
- public string Describe()
- {
- return "This car is " + Color;
- }
- public string Color
- {
- get { return color; }
- set { color = value; }
- }
- }
- }
Add Comment
Please, Sign In to add comment