1. Start by introducing itsThe first and most important article://Global variablevoid msg () {printf ( "hello\n "//main.c int main () {extern char A; // extern variable must be declared before use printf ( "%c " , a); (void) msg (); return 0
1. Objects that can be decorated are: variables, methods, blocks of codeThe corresponding is: Static variable/class variable; static method; static codeEg: public class student{public static int a = 0;public static int GetValue () {return A;}}2.
What does 1.static mean?Static means "global" or "static". In Java, there is no concept of global variables, static can be simply understood as a global, independent of a function. (1) When we use static to modify member variables or member methods,
2. Static keywordVariables: Static variables exist in memory only one copy, only initialized once when the class is first instantiated, and all instances of the class share static variables, you can access the class name directly.Method: The static
1. Static in process-oriented design1.1 Static global variablesThe variable is defined as a static global variable before the global variable, plus the keyword static. Let's first give an example of a static global variable, as follows:
Copy
This article describes the Java static keyword usage, share for everyone to reference. The specific analysis is as follows:
First, Introduction:
1. In the class, the member variable declared with static is a static member variable, which is the
The keyword static keyword is also more important in ActionScript 2.0. If an attribute is static, then we can call it directly ...
static (Static) keywords are also important in ActionScript 2.0. If an attribute is static, then we can call it
For compatibility with PHP4, if "visibility" is not specified, properties and methods are public by default.
The pseudo variable $this is not available in static methods because the static method does not need to be invoked through the
The following from the assembly language to see its principle.
The following is the C + + source code:
Copy Code code as follows:
void Add () {
static int i = 1;
i++;
}
int main () {
Add ();
}
here is the
Typically, when we create a class, we point out the appearance and behavior of the object of that class. You don't actually get anything unless you create an object of that class with new. Only when new is executed will the data storage space be
Static is the meaning of statics.Static keyword:1.static modified variables are called "Static variables".The 2.static retouching method is called a "static method".3.static can also define static statement blocks.The following example shows a
The first is a set of code:
Abstract class user {} class admin extends user {private $ group; public static function create () {return new admin ();} public static function getgroup () {return "admin ";}//....... other functions ..}
Class
1. Overview
Static declared variables have two features in the C language:
1) The variables will be placed in the global storage area of the program, so that the original values can be maintained during the next call. This is the difference between
The static function of C ++ has two usage methods: static in process-oriented programming and static in object-oriented programming. The former applies to common variables and functions, and does not involve classes. The latter mainly describes the
/*static Features: (It can modify member variables and can also modify member methods) A: Loads the recall Main method as the class loads. B: Precedence over object existence C: shared by all objects of the class example: class students should share
Static member functionsAs with static data members, we can also create a static member function that serves the entire service of a class rather than the specific object of a class. Static member functions, like static data members, are internal
Original link: http://www.orlion.ga/781/I. Links to multi-objective filesSuppose there are two files: stack.c:/* STACK.C */char stack[512];int top = -1;void push (char c) {stack[++top] = C;} Char pop (void) {return stack[top--];} int Is_empty (void)
Difference between the static keyword and final keyword in java, staticfinal
Static
1. static attributes are called static attributes in a class. All objects of this class are shared and stored in the static storage area. All objects of this class
Static properties and methods can be called without instantiating the class, directly in the way they are used 类名::方法名 . Static properties do not allow an object to be called with an operator. In a static method, $this pseudo-variable is not allowed.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.