A
ad
We can define a static member in a class.
But can we define a static class, so that all members are static?
But can we define a static class, so that all members are static?
Ajay Kalra said:What do you mean by a static class? Are you thinking Singleton pattern so
that there is only one instance of this class?
--
Ajay Kalra [MVP - VC++]
(e-mail address removed)
ad said:We can define a static member in a class.
But can we define a static class, so that all members are static?
ad said:Thank,
I do'nt know what is Singleton pattern.
I want a static class so that every members in it can be static as the
module in vb.net
Ajay Kalra said:What do you mean by a static class? Are you thinking Singleton pattern so
that there is only one instance of this class?
--
Ajay Kalra [MVP - VC++]
(e-mail address removed)
ad said:We can define a static member in a class.
But can we define a static class, so that all members are static?
Ajay Kalra said:I dont know VB.Net. I think a sealed class with a private constructor will
be close to what you want.
--
Ajay Kalra [MVP - VC++]
(e-mail address removed)
ad said:Thank,
I do'nt know what is Singleton pattern.
I want a static class so that every members in it can be static as the
module in vb.net
Ajay Kalra said:What do you mean by a static class? Are you thinking Singleton pattern so
that there is only one instance of this class?
--
Ajay Kalra [MVP - VC++]
(e-mail address removed)
We can define a static member in a class.
But can we define a static class, so that all members are static?
ad said:Thank!
Can you give me an example?
Ajay Kalra said:I dont know VB.Net. I think a sealed class with a private constructor will
be close to what you want.
--
Ajay Kalra [MVP - VC++]
(e-mail address removed)
patternad said:Thank,
I do'nt know what is Singleton pattern.
I want a static class so that every members in it can be static as the
module in vb.net
"Ajay Kalra" <[email protected]> ¼¶¼g©ó¶l¥ó·s»D
:[email protected]...
What do you mean by a static class? Are you thinking Singleton
sothat there is only one instance of this class?
--
Ajay Kalra [MVP - VC++]
(e-mail address removed)
We can define a static member in a class.
But can we define a static class, so that all members are static?
Bruce Wood said:Using "abstract" in this situation won't work. The compiler will
complain that the class contains no abstract methods or properties.
You should, as Ajay pointed out, use "sealed" here, which indicates
that no other classes can inherit from this one.
Richard Blewett said:However, this ability is coming in V2.0
static class Foo
{
public static void Bar()
{
}
}
This creates a sealed abstract class so you cannot create an instance
ad said:We can define a static member in a class.
But can we define a static class, so that all members are static?