Guest User

Untitled

a guest
Jun 24th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace ConsoleApplication1
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             Block block = new Block("Grass");
  12.             Console.WriteLine(block.Describe());
  13.             Console.ReadLine();
  14.         }
  15.     }
  16.  
  17.     class Block
  18.     {
  19.         private string bType;
  20.  
  21.         public Block(string BlockType)
  22.         {
  23.             bType = BlockType;
  24.         }
  25.  
  26.         public string Describe()
  27.         {
  28.             return "This block is made of " + bType;
  29.         }
  30.  
  31.         public string Color
  32.         {
  33.             get { return bType; }
  34.             set { bType = value; }
  35.         }
  36.     }
  37. }
Add Comment
Please, Sign In to add comment