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();
        }

    }

}

Recommended Answers

All 2 Replies

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

thank you for the reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.