0

What is the difference between displayClassA and DisplayClassb?
When creating classes should i put them outside of the Stuff Class or insisde?
What's the difference?

using System;
using System.Collections.Generic;

namespace Empty
{

        public class DisplayClassA
        {
            public DisplayClassA(){Console.WriteLine("This Class is outside of STUFF");}
        }


    public class Stuff
    {   
        public class DisplayClassB
        {
            public DisplayClassB(){Console.WriteLine("This Class is inside of STUFF");}
        }           


        static void Main(string[] args)
        {
               DisplayClassA a =new DisplayClassA();
               DisplayClassB b =new DisplayClassB();
        }

    }

}
2
Contributors
2
Replies
18
Views
4 Years
Discussion Span
Last Post by treasure2387
0

A nested class, as DisplayClassB would be called, is usualy marked as private and can only be used in the enclosing class.

Edited by ddanbe: typo

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.