Does type and class mean the same thing?

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

As I read the documentation sometimes it appears that "type" and "class"
mean the same thing. Other times it appears that they do not.

Under "Classes" mostly they use the word "class" but I also see:

sealed Specifies that another type cannot be derived from this type.

and

Nested classes also have member characteristics. For more information,
see Type Members.

Looks like the words are interchangeable.

BUT under Delegate Class I see

The Delegate class is the base class for delegate types.

and

The Delegate class is not considered a delegate type; it is a class used
to derive delegate types.

Looks like there is a distinction.

Maybe a type is just a class that can be instanced???

Comments please.
 
Hi,

I believe a Type is just a common name for everything an object can hold,
which can be classes, interfaces, arrays, structs, enumerations etc. So,
a class is a type, but a type may not necessarily be a class.
 
To Me... A type is a named public interface of an object. An object
can
implement one or more named interfaces. A type can be shared across
different classes, but the implementations may differ. By interface, I
mean a
named set or subset of signatures of an object's operations. So objects
have
class and references have type.

http://www.geocities.com/jeff_louie/OOP/oop6.htm

Regards,
Jeff
As I read the documentation sometimes it appears that "type" and
"class"
mean the same thing. Other times it appears that they do n<
 
Just Me said:
As I read the documentation sometimes it appears that "type" and "class"
mean the same thing. Other times it appears that they do not.

Back in the "old" days, datatypes (types) were things like integer,
character, string, float, boolean, etc. You could create your
own enhanced types using things like structures and enumerations.

We didn't have "objects" or "classes" back then. But a
class is essentially an enhancement of the structure idea.
So, I would say that a class is a new category of datatype.
A very powerful category of datatype that supports
encapsulation, inheritance, polymorphism and all that good stuff.
 
Thanks

Scot McDermid said:
Back in the "old" days, datatypes (types) were things like integer,
character, string, float, boolean, etc. You could create your
own enhanced types using things like structures and enumerations.

We didn't have "objects" or "classes" back then. But a
class is essentially an enhancement of the structure idea.
So, I would say that a class is a new category of datatype.
A very powerful category of datatype that supports
encapsulation, inheritance, polymorphism and all that good stuff.
 
Back
Top