Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
When we use static keyword in c#.net?
Why we use static keyword in c#.net?
 
what is the keyword used in vb.net for static in c#.net ?
 
Is any feature not available for static among vb.net and c#.net ?
Posted 29-Apr-11 3:05am
Comments
Sandeep Mewara at 29-Apr-11 8:16am
   
:doh: Google?
Rajesh Puli at 29-Apr-11 8:25am
   
No Effort
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

See here: What is "static" in C#?[^].
 
See here for the Static analogon in VB[^].
 
Best Regards,
 
-MRB
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hello,
 
The static keyword defines, that the class / property / method you declare as static does not require an previous instance of a object. In the other hand, a static method for example cannot use any instance method / instance property of the own object.
 
Also static defined things will be optimized by the compiler, for example that a static object is only written once in the memory and everything accesses to the same object.
 
Here you get perhaps more detailed informations about the static keyword:
http://msdn.microsoft.com/en-us/library/98f28cdx.aspx[^]
 
Also a google search would help:
http://www.google.com/[^]
 
I'm sorry about not answering the VB Questions, but I'm not a VB specialist and do not know how this is solved in VB.NET. Perhaps google have some more answers.
 
Hope this helps.
 
Best regards and have a nice weekend,
Stops
  Permalink  
Comments
Manfred R. Bihy at 29-Apr-11 8:32am
   
Yes OP should have been able to find the complete solution by himself, but what the heck!
5+
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Static keyword C#[^]
 
static vb.net[^]
 
Wasn't that simple. Do search before you ask.
 
PS - the answer will move your question out of the unanswered list.
  Permalink  
Comments
Manfred R. Bihy at 29-Apr-11 8:31am
   
Quite easy I'd say! 5+
Ankur\m/ at 29-Apr-11 8:38am
   
Thanks and to you too!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

This article might be a good help:
 
Static Keyword Demystified[^]
 
The keyword in VB.net to do the same thing is
 
Shared
 
Tim
  Permalink  
Comments
Manfred R. Bihy at 29-Apr-11 8:31am
   
Yup! 5+
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

Hello...

when we use static key word it means there is no need to create an instance of object . static class including a static method can called
by class name.
note that static class can have only static methods
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Peter Leow 313
1 Kornfeld Eliyahu Peter 220
2 Maciej Los 160
3 Sergey Alexandrovich Kryukov 157
4 OriginalGriff 153
0 Peter Leow 443
1 OriginalGriff 403
2 Kornfeld Eliyahu Peter 260
3 Sergey Alexandrovich Kryukov 242
4 Maciej Los 230


Advertise | Privacy | Mobile
Web03 | 2.8.150301.1 | Last Updated 24 Aug 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100