예제 #1
0
        static void Main(string[] args)
        {
            Animals animal = new Animals();

            Animals.Dogs dog = new Animals.Dogs();
            Animals.Cats cat = new Animals.Cats();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Nested Classes!");
            Animals animal = new Animals();

            //Cannot access Cat or Dog
            animal.animalCountry = "USA";

            //Declare Dogs within Animals
            Animals.Dogs dog = new Animals.Dogs();
            dog.dogBreed = "German Sheperd";

            //Declare Cats within Animals
            Animals.Cats cat = new Animals.Cats();
            cat.catName = "Mr Piffles";
        }