Java static keywords and Java statics and static methodsThe static modifier can be used with a variable, a method, and represents a "static".
Static variables and static methods can be accessed through the class name and do not need to create an
One, static variable
The member variable decorated by the static keyword is called a static variable, and before we talk about the difference between a member variable and a local variable, what is the difference between a static variable and a
static denotes "global" or "static" meaning, used to decorate member variables and member methods, or to form static-code blocks, but the concept of global variables is not available in the Java language.
The member variables and member methods
JAVA keyword and its role explanation 1. Access control 1) Private privateThe Private keyword is an access control modifier that can be applied to a class, method, or field (a variable declared in a class). These classes, methods, or fields can only
Key concepts: Abstract classes, abstract methods, static classes, static internal classes, static methods, static variables, constants, global constants.
I. The use of abstract, modifier, you can modify class and Method 1, abstract modifier class,
In Java thread concurrency processing, there is a great deal of confusion about the use of a keyword volatile, thinking that by using this keyword, you can do everything in parallel with multithreading. The Java language supports multithreading, in
Generally speaking, when you create a class, you are describing the appearance and behavior of the object of that class. Unless you create the object of that class with new, you don't actually get anything. When you create an object with new, the
1. Static methodsIn general, defining a method in a class is static, which means that you do not need an object of this class to call this methodThe method declared as static has the following limitations:· They can only invoke other static methods.·
1. Static methodsIn general, defining a method in a class is static, which means that you do not need an object of this class to call this methodThe method declared as static has the following limitations:· They can only invoke other static methods.·
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.