|
-
Dec 21st, 2005, 10:36 PM
#1
Thread Starter
Fanatic Member
defination of terms
I made already some windows application from c# but i dont knw the defination of the ff. I hope someone will answer this.
1.namespace
2.class
string test() {}
is this a function? In Vb im sure this is a function but i dont knw the right term in c#.
thanks
Popskie
-
Dec 22nd, 2005, 12:59 AM
#2
Re: defination of terms
The definitions of classes and namespaces are the same in C# and VB.NET. A namespace is just a conceptual area in which all names are unique. For instance, you can have two types with the same name but they must be in different namespaces. It's just like files and folders. You can have as many different files with the same name as you like, but each one must be in a different folder. A class is the most common sort of type in OO languages. It is named so because the class definition describes a class of objects. It describes the data (fields and properties) and the behaviour (methods) of that class of objects. Generally speaking, any time you can give a general term to an object in the real world, that term could be mapped to a class in an OO language. For example, every car is an instance of the Car class. It could also be an instance of a class that inherits Car, like HatchBack, and it would definitely be an instance of all classes that Car inherits, like Vehicle. .NET classes have certain other attributes that distinguish them from other .NET types, such as structures. One of the main differences between classes and structures is that an instance of a class is stored on the heap and a variable of that type will contain the memory address of that object rather than the object itself, while an instance of a structure is stored on the stack and is itself contained in the variable.
In C-based languages the more general name for a function is a method, which is also now used in VB.NET. C# has no equivalent to the VB procedure (Sub). All methods in C# are functions and, if they do not return a value, their return type is "void".
Last edited by jmcilhinney; Dec 22nd, 2005 at 01:03 AM.
-
Dec 22nd, 2005, 03:29 AM
#3
Thread Starter
Fanatic Member
Re: defination of terms
thanks jm for the very nice input.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|