Hi, My friends,

Who would like to help me figure out the diffrence between type and class.
In dotnet framework why don't use class, but every type looks very similar
to a class.

What's the diffrence?

I really appreciate your help.

Larry

Re: What's the diffrence between and class? by Jon

Jon
Thu Jul 24 08:42:14 CDT 2003

Larry <lchang@andec.ca> wrote:
> Who would like to help me figure out the diffrence between type and class.
> In dotnet framework why don't use class, but every type looks very similar
> to a class.
>
> What's the diffrence?

Every class is a type (in fact, it's a reference type), however there
are also value types, which are types but not classes. Have a look on
page 27 of the ECMA spec partition 1 for a nice diagram showing it all.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Re: What's the diffrence between and class? by Tom

Tom
Thu Jul 24 08:49:19 CDT 2003

The Type is just a model for holding multiple data items, where a class can
process that information internally. You can overload a class, not a type. A
Class can be used by other processes, where a type is local to the
application. The list of difference goes on, suffice to say. If you need a
structure to simply store data in a single application then a type will do
fine. If not, then you may need (a) class. ;)
Tom

--
==========================================
= Tom Vande Stouwe MCSD.net, MCAD.net, MCP
= 45Wallstreet.com (www.45wallstreet.com)
= (803)-345-5001
==========================================
= If you are not making any mistakes
.= ..you are not trying hard enough.
==========================================
"Larry" <lchang@andec.ca> wrote in message
news:vhvo83tdpcbe7c@corp.supernews.com...
> Hi, My friends,
>
> Who would like to help me figure out the diffrence between type and class.
> In dotnet framework why don't use class, but every type looks very
similar
> to a class.
>
> What's the diffrence?
>
> I really appreciate your help.
>
> Larry
>
>



Re: What's the diffrence between and class? by BenoitM

BenoitM
Thu Jul 24 08:52:44 CDT 2003

don't totally understand your question, but will try to answer it anyway ;)

in .net everything is object, but there's two kind of object : reference
type (classes) and value type (structures).

in the .net framework, there's a class named 'Type', but it's used as part
of Reflection , and it represent a type declaration (class, structures,
interfaces, enums, and so on ...) with this class your can obtain many
information about a type : methods, properties, events, etc....



"Larry" <lchang@andec.ca> wrote in message
news:vhvo83tdpcbe7c@corp.supernews.com...
> Hi, My friends,
>
> Who would like to help me figure out the diffrence between type and class.
> In dotnet framework why don't use class, but every type looks very
similar
> to a class.
>
> What's the diffrence?
>
> I really appreciate your help.
>
> Larry
>
>



Re: What's the diffrence between and class? by Jon

Jon
Thu Jul 24 08:55:06 CDT 2003

Tom Vande Stouwe MCSD.net <tomv@conpro.net> wrote:
> The Type is just a model for holding multiple data items, where a class can
> process that information internally. You can overload a class, not a type.

No, you overload a method.

> A Class can be used by other processes, where a type is local to the
> application.

Where are you getting this from? A class *is* a type.

> The list of difference goes on, suffice to say. If you need a
> structure to simply store data in a single application then a type will do
> fine. If not, then you may need (a) class. ;)

Are you confusing struct with type here, perhaps?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Re: What's the diffrence between and class? by Jon

Jon
Thu Jul 24 11:08:34 CDT 2003

Pamela Thalacker <pamela@eagle-crest.com> wrote:
> What is the ECMA spec and where do I find it?

See http://www.ecma-international.org

The standard I was referring to is ECMA 335.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too