Home > Net >  About the use of static
About the use of static

Time:09-30

Variable declarations into static words when the program exits to release space
And all is a static class, non-static objects all
For example,
Class A
{
Public static void Fun1 () {};
Public void Fun2 () {};
}
Use Fun1 A.F directly un1 () is ok, if you practical Fun2 must an object instance

CodePudding user response:

CodePudding user response:

Yes, static non-static call level, is a static object level, non-static is the instance level, static resource will have been occupied, so use less as far as possible,

CodePudding user response:

The difference between static and non-static, the static modifier can be used directly, non-static methods are new to use,

CodePudding user response:

The module in the static static class is vb.net

CodePudding user response:

Static drops, singleton is the static

CodePudding user response:

Static members are already defined at compile time, non-static member is just can use after the air runtime object generated,
# 5 floor singleton is not static, idlers under the model of single case, when the singleton object is not initialized, and cannot use its members,

CodePudding user response:

What is your problem? If technical summary, can go to send to your blog

CodePudding user response:

so what's the point

CodePudding user response:

refer to the eighth floor caozhy response:
what is your problem? If technical summary, can go to the blog to send

Excuse me where is the hair? I just don't know to send here

CodePudding user response:

refer to the eighth floor caozhy response:
what is your problem? If technical summary, can go to the blog to send

Crab crab 8 floor, I know, the mobile version can not send, can send computer version only

CodePudding user response:

SO... I come to pick up points, wood ha ha ha

CodePudding user response:

Small bad egg I promise I will not beat you

CodePudding user response:

BBS reply will give points? Other fuzzy ah, this problem does ask you now generally sufficient system resources, need not consider too much consumption of resources, the static is more used for global references not change parameters and logic code (that is, global function), not class is object-oriented encapsulation,

CodePudding user response:

You don't have to ask questions? Or send the wrong place?

CodePudding user response:

The building has a good summary, static fields and methods, to be quoted by class; The static objects of a class instance (or call) is required to reference,

CodePudding user response:

references 9/f, self-study program 2 days reply:
so what's the point

Without a key, or you guess

CodePudding user response:

The basic problem, send subtopic

CodePudding user response:

Access static members isn't A: : Fun1 ()? , you can directly order operation?

CodePudding user response:

So the question is what??

CodePudding user response:

CodePudding user response:

CodePudding user response:

reference 22 floor was C response:

Don't think I don't know you from running water irrigation

CodePudding user response:

reference 23 f why_are_you_so_diao_ response:
don't think I don't know you from running water irrigation

Don't talk nonsense, I come to learning technology

CodePudding user response:

reference 24th floor was C response:
Quote: reference 23 f why_are_you_so_diao_ response:

Don't think I don't know you from running water irrigation

Don't talk nonsense, I'm here to learning experience technology


Your flower flower betrayed you! nullnullnullnullnullnull
  •  Tags:  
  • C#
  • Related