1. Design pattern: A problem-solving idea. The most effective way to solve a certain kind of problem. Java has 23 design patterns (summed up by predecessors).
Single-Example design pattern: Resolves a class that has only one object in memory.
if a
final VariableIf the final keyword is added before a variable, the variable cannot be changed once it is initialized.
If a final variable is a class member variable, it must be initialized and can only be initialized once.
The parameter in the
Accumulation of knowledge points
1. Important points of knowledge about final:
The final keyword can be used for member variables, local variables, methods, and classes;
Final
Final Variable (Before the keyword final is added to the defined variable, the variable is not changed once it is initialized.)
The specific meaning of an immutable term is:
Basic type whose value cannot be
Each class is compiled with a class object stored in the. class file, and the JVM uses the ClassLoader (class Loader) to load the class's bytecode file (. Class), the ClassLoader is essentially a classloader chain, in general, we only use a native
Abstract Abstraction
method
Abstract method: The method of an abstract modification, which is only declared without the implementation of the method (not even {}).
syntax: modifier Returns a value type
The inner classes can be static (static) and can use public, protected, and private access controls, while external classes can use only public, or default.A class that is directly defined within a member's inner class (not inside a method or inside
the application of this keyword in the Java languageApply one: Reference member variable Public class // defines a class whose name is student. Public // define a method, with the same name as the class, so it is a construction method This
Final keyword (can be read, not writable, read-only)1. The value of the final variable cannot be changed①, final member variable②, final local variable (formal parameter)//meaning "argument" is not allowed to change once it is passed into my method2.
This article is intended to help you prepare to learn about Java and the use of the static, this, super, final, and other keywords used by friends who are just in touch with Java. Java is profound, I am also a learning and use of Java enthusiasts,
First, Static and final Learning Java for so long, as if they did not use the final, so the understanding of fianl is not enough. Final appears not only in the modification of variables, but also in methods and classes. The final class cannot be
Just see the Forum recommendation, Ali's school recruit did not expect to start at the end of August, such as spring recruit again to try, now still too tender point.Place the definition of one class into the inner-inner class of another class
When I met this problem today, it is really difficult to understand, only know that the variables in interface by default are modified by public static final, the method in the interface is decorated by public and abstrct. Consulted a lot of
There are three uses for final in Java: Final member variable when you define a variable in a class, precede it with the final keyword, that is, the variable is immutable once it is initialized, and the immutable meaning here is the value immutable
Final is not used in Java, but it provides us with functions such as defining constants in C, and final allows you to control your members, your methods, or whether a class can be overwritten or inherited. These characteristics make final in Java
Access control is annoying, you ' re going to love this artical.
Access modifiers (from less restrictive to more restrictive):
Public , Protected, default (package access), Private
Non-access modifiers (inluding final, abstract and STRICTFP)
1.
In the study of the deep understanding of Java Virtual Machines, the chapter on initialization of a class mentions that a static statement block can only access a variable defined in a static statement block, a variable that is defined after it,
Final classthe final class cannot be inherited, and once the class is modified with final, it means that all the methods in the final class are implicitly specified as the final method
Final methodin the process of inheriting a class, subclasses
Static, this, super, final usage in Thinking:java
This article is designed to help people who are ready to learn Java and just contact Java to recognize, master, and use the static, this, super, final, and other keywords. Java profound, I am
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.