ch3p-Match (a type of Tool)
AppParty Tool | Chapter_4 |
Match.cs
namespace party.house.rooms.tools
{
class Match : Tool // Match is a type of Tool
{
public Match(string name) : base(name) // call base constructor
{}
public void Light()
{
System.Console.WriteLine("Lighting a match");
}
override public string ToString()
{
string message = base.ToString(); // name
message += " is practical";
return message;
}
}
}
AppParty Tool | BACK_TO_TOP | Chapter_4 |
Comments
Post a Comment