namespace CompanyName
{
public class Car
{
public string make;
}
}
namespace DifferentCompany
{
public class Car
{
public string make;
}
}
class MainClass
{
public static void Main()
{
System.Console.WriteLine("Creating a CompanyName.Car object");
CompanyName.Car myCar = new CompanyName.Car();
myCar.make = "Toyota";
System.Console.WriteLine("myCar.make = " + myCar.make);
System.Console.WriteLine("Creating a DifferentCompany.Car object");
DifferentCompany.Car myOtherCar = new DifferentCompany.Car();
myOtherCar.make = "Porsche";
System.Console.WriteLine("myOtherCar.make = " + myOtherCar.make);
}
}
|