0

Hi all,
I am new to C#(programming). Could you tell me a good link for C#.

Could you please tell me the use of STATIC keyword use in C#.
why static is used in the following line what are the advantages..?
public static class myclass{
.....................
}
Thanks and regards

3
Contributors
7
Replies
8
Views
9 Years
Discussion Span
Last Post by pointers
0

A static class can never be instantiated as an instance in memory. It is just a collection of static functions and member data.

so:

myclass class = new myclass() //causes compiler error

but:

myclass.someMethod() //this is ok

All member variables and methods must also be static in a static class.

I use 'Professional C# 2005' published by Wrox. It's an excellent reference.

0

It would do, but the slash is the wrong way round in the url. It may work in some browsers but it dies in FF 1.5 on my PC. :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.