0
comments
Posted by
Belbinson Toby ,
Thursday, June 4, 2020
11:15 PM
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
ConsoleApp1
{
interface
IBMW
{
void
CreateCar();
}
interface
IToyota
{
void
CreateCar();
}
public
class
CarFactory
: IBMW, IToyota
{
void
IBMW.CreateCar()
{
Console.WriteLine("Creating
BMW");
}
void
IToyota.CreateCar()
{
Console.WriteLine("Creating
Toyota");
}
}
class
Program
{
static
void
Main(string[]
args)
{
IBMW
objBMW = new
CarFactory();
IToyota
objToyota = new
CarFactory();
objBMW.CreateCar();
objToyota.CreateCar();
Console.ReadLine();
}
}
}
Subscribe to:
Comments (Atom)