Optimization usually consists of two parts: reducing the volume of the Code and improving the efficiency of the Code.1. The class that specifies the final modifier of the class with the final modifier is not derived as much as possible. In the Java
Four Java basic questions, how many ways can you tell?
The use of a/= characterfirst, take a look at some more interesting code.
Integer a = 1000,b=1000;
Integer C = 100,d=100; public void Mrun (final String name) {
new Runnable ()
There are three usage scenarios for the final keyword:
Final Modifier class
Final Modification method
Final modifier variable
The final decorated class, which can no longer inherit from a subclass.A class can be designed as a final
resources available for the program to use (memory, CPU time, network bandwidth, etc.) is limited, the purpose of optimization is to allow the program to use asLess resources to complete the scheduled tasks. Optimization usually consists of two
The examples in this article Summarize Java performance optimization techniques. Share to everyone for your reference. The specific analysis is as follows:
Here is a reference to some books, network resources sorted out, suitable for most Java
Program | performance | Optimization
1 using non-blocking I/O
The less-than-version JDK does not support non-blocking I/O APIs. To avoid I/O blocking, some applications use a method of creating a large number of threads (in better cases, a buffer
Here are some of the things you can do in Java programming that refer to the summary of your network resources.
1. Try to use a single case on the right occasion
Using a single example can reduce the load burden, shorten the loading time, improve
Skills | experience | performance | optimization
One, general article
The issues discussed in "common article" are appropriate for most Java applications.
1.1 Create an instance of a class without the New keyword
When you create an instance of a
as a result of the exam, for a long time have not been able to write blog (when out of the Csdn-markdown editor), today on the code optimization aspect to write a blog post, mainly about Java . The quality of good code:
1. Concise
2. Strong
For the machine memory is full, in addition to new machine memory, but also should be well review our code, there are many code to write too casually, these bad habits or the language of the program is not understood to be a good suppression of
Here are some of the things you can do in Java programming as a summary of the reference network resources.1. Try to use a single case in the appropriate situationUsing a single example can reduce the load burden, shorten the loading time, improve
Java Abstract, interface and final, java Abstract interface finalAbstract 1. abstract class: a class that does not know what it is. Abstract class name
1. abstract classes cannot be new directly.
2. abstract classes can have no abstract
No. 2 object and memory control (memory allocation), No. 2 object
1. instance variables and class variables
Member variables VS local variables
Local variables (stored in method stack memory)
Parameter: defined in the method signature. It is
Java study notes 18 --- final keywords modify variables, methods, and classes, study notes 18 --- final
The word final in English is known as "final". In fact, it also means"Unchangeable". In Java,The final keyword is "unchangeable" to better
Package catalog concept, the box packages are placed at the front of the source file, the pack statement can only have one, multi-layer "." SegmentationHow to use the package, the same packet class direct reference, different packages import package
Java modifier and java Modifier
The Java language provides many modifiers, mainly divided into the following two types:
Access Modifier
Non-access modifier
Modifiers are used to define classes, methods, or variables. They are usually placed at
Java memory management is divided into two areas: memory allocation and Memory recyclingThe inability to squander Java's memory allocations can result in inefficient Java programs:Constant memory allocation reduces the amount of available memory in
/* Internal class overview: Define classes Inside other classes, which are called inner classes. Example: A class B is defined in Class A, and Class B is an inner class. Internal Access features: A: Inner classes can access members of external
Java (2), java (2)
Briefly describe the operating mechanism of the constructor
The first thing to note is that the constructor is not a function, so it cannot be inherited. This is common when we write sub-class constructor in extends, even if
Static methodsAs with static variables, we can also use the static modification method, called a static method or a class method.In fact, the main method we've been writing about is static methods.A static method can directly invoke a static member
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.