I am confuse about type and class in some book about C#.
What is the difference between type and class? 4 6484
They are basically the same i guessed.
Also, there is a class called Type in .NET. To get a type from a class
you would go Type t = typeof(ClassName);
On Mon, 24 Jan 2005 15:15:50 +0800, "ad" <ad@wfes.tcc.edu.tw> wrote: I am confuse about type and class in some book about C#. What is the difference between type and class?
"Type" is used when we are discussing types. In simple words, you see that
whenever we use variables, they "always" have a type no matter if they are
int, float, string, stringbuilder, FileStream. They are all types, but not
all of them are classes! int is not a class, it is a struct or "value type"
in .net terminology.
Ab. http://joehacker.blogspot.com
"qwerty" <no@email.net> wrote in message
news:a6********************************@4ax.com... They are basically the same i guessed.
Also, there is a class called Type in .NET. To get a type from a class you would go Type t = typeof(ClassName);
On Mon, 24 Jan 2005 15:15:50 +0800, "ad" <ad@wfes.tcc.edu.tw> wrote:
I am confuse about type and class in some book about C#. What is the difference between type and class?
The way I see it, a type is anything that can be used to "type" a variable.
And that doesn't always need to be a class. Enumerations, for example, are
not classes but they are types because a variable can be typed as an
enumeration.
In general, the .NET Framework recognizes these types:
- Value types, for example int, bool, and any enumerations and structs you
create in your code.
- Reference types, i.e., classes, interfaces, arrays, and delegates.
Hope this makes sence.
--
Michal Boleslav Mechura va******@hotmail.com
"Abubakar" <em**********@yahoo.com> wrote in message
news:um**************@tk2msftngp13.phx.gbl... "Type" is used when we are discussing types. In simple words, you see that whenever we use variables, they "always" have a type no matter if they are int, float, string, stringbuilder, FileStream. They are all types, but not all of them are classes! int is not a class, it is a struct or "value type" in .net terminology.
Ab. http://joehacker.blogspot.com
"qwerty" <no@email.net> wrote in message news:a6********************************@4ax.com... They are basically the same i guessed.
Also, there is a class called Type in .NET. To get a type from a class you would go Type t = typeof(ClassName);
On Mon, 24 Jan 2005 15:15:50 +0800, "ad" <ad@wfes.tcc.edu.tw> wrote:
>I am confuse about type and class in some book about C#. >What is the difference between type and class? >
ad... it depends on the definition of type. if you define type as a
public interface then a class can have many types. a reference variable
has type and an object has class.
Regards,
Jeff What is the difference between type and class?<
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brandon J. Van Every |
last post by:
What's better about Ruby than Python? I'm sure there's something. What is
it?
This is not a troll. I'm language shopping and I want people's answers. I
don't know beans about Ruby or have...
|
by: Brandon J. Van Every |
last post by:
I'm realizing I didn't frame my question well.
What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump
up in your chair and scream "Wow! Ruby has *that*? That is SO...
|
by: Shea Martin |
last post by:
I have been programming in C++ for over 4 years. I *think* I knew that
a struct could have a constructor but I decided to dig into it a little
more today, and found that there is very little...
|
by: Jason Huang |
last post by:
Hi,
Would someone explain the following coding more detail for me? What's the
( ) for?
CurrentText = (TextBox)e.Item.Cells.Controls;
Thanks.
Jason
|
by: Xah Lee |
last post by:
in March, i posted a essay “What is Expressiveness in a Computer
Language”, archived at:
http://xahlee.org/perl-python/what_is_expresiveness.html
I was informed then that there is a academic...
|
by: SemSem |
last post by:
i want to know waht is an index and how we use it with a simple example
including the main of the program .
thanx
--
Islam Khalil,
|
by: JonathanOrlev |
last post by:
Hello everyone,
I have a newbe question:
In Access (2003) VBA, what is the difference between a Module and a
Class Module in the VBA development environment?
If I remember correctly, new...
|
by: Jess |
last post by:
Hello,
I understand the default-initialization happens if we don't initialize
an object explicitly. I think for an object of a class type, the
value is determined by the constructor, and for...
|
by: Nikolaus Rath |
last post by:
Hello,
Can someone explain to me the difference between a type and a class?
After reading http://www.cafepy.com/article/python_types_and_objects/
it seems to me that classes and types are...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |