P
puzzlecracker
Would you quickly remind me the difference between, regular class,
static class, and nested class?
Thanks
static class, and nested class?
Thanks
puzzlecracker said:Would you quickly remind me the difference between, regular class,
static class, and nested class?
Anthony said:A 'regular' class my be used to create object instances for which the
class is the type. Each instance will hold a set of fields which
hold values for that instance only. A class may also contain static
members which may be fields, properties or methods which are common
across all instances of the class. Such static members are accessed
through the Type name.
A class marked as static may only contain static members and
instances of a static class cannot be created.
A nested class is a class that is defined inside another class. One
difference that a nested class has from a regular class is that it
may be private where it can only be used inside the class definining
it, whereas a regular class cannot be private.