essence of the String class is the character array char [], and its value cannot be changed. Private final char value [];3. A String object has a special creation method. For example, String x = "abc"; "abc" indicates a String object, and x indicates the address of the "abc" object, it is called "abc" reference.4. A String pool (String pool) is maintained during Java
application is quite large. For example, in the first article, there is no indication of where the binary stream will come from or how it should be, so this alone can produce many tricks:· Obtained from the ZIP package, which is the basis for future jar, ear, and war formats· Get from the network, the typical application is the applet· Run-time compute generation, typical application is dynamic agent technology· Generated by other files, the typical
loader, Application ClassLoader, and class library in ClassPathThe custom class loader is implemented by inheriting the ClassLoader. Generally, it loads our custom class.Parent-Child Assignment Model
Similar to other Java classes, the Class Loader must load the Class Loader
create a string is as follows:When you encounter a string constant in your code, the value here is "Hello world!", which the compiler uses to create a string object. Create a characterString Object greeting= "Hello world!"; , the Java runtime (the running JVM) will hold this "IMOOC" Hello world!; In the string pool, find out whether to saveA string "Hello world!" is created in the pool if it does not exist in the same string object as the content, ot
class loader loads a class into the JVM, taking the following steps:
(1) Load: Find and Import Class file, (2) Link: Merge binary data of class into JRE; (a) Verify: Check the correctness of loading class file data; (b) Prepare: Allocate storage space for static varia
the virtual machine implementation and the specific application is quite large. For example, in the first article, there is no indication of where the binary stream will come from or how it should be, so this alone can produce many tricks:· Obtained from the ZIP package, which is the basis for future jar, ear, and war formats· Get from the network, the typical application is the applet· Run-time compute generation, typical application is dynamic agen
Today, I wrote a multi-threaded program and found that when the internal class is defined in the method, if the internal class calls the variable in the method, the variable must be declared as the final type and cannot be understood, later I thought it should be the cause of the life cycle, because the variables defined in the method are local variables. When I leave the method, the variables will become u
ExtClassLoader, and his father cannot obtain ExtClassLoader because it is implemented in C ++.3. Parental Appointment Mechanism
When receiving a request for loading a class, a specific class loader first delegates the loading task to the parent class loader.Delegate a load task to an upstream NodeUntil the parent class
group is always a sub-sequence that matches the group most recently. If the group is recalculated because of quantization, it retains its previously captured value (if any) on the second calculation failure, for example, the string "ABA" with an expression (a (b)?). + matches, the second group is set to "B". At the beginning of each match, all captured input is discarded.Second, detailed pattern class and
always a sub-sequence that matches the group most recently. If the group is recalculated because of quantization, it retains its previously captured value (if any) on the second calculation failure, for example, the string "ABA" with an expression (a (b)?). + matches, the second group is set to "B". At the beginning of each match, all captured input is discarded. Second, detailed pattern class and Mat
Writing a multithreaded program today, discovering that inside a method defines an inner class, if the inner class calls the variable in the method, then the variable must be declared as the final type, baffled, and then thought of as the cause of the life cycle, because the variable defined in the method is a local variable, leaving the method, the variable loses its function , it will automatically be eli
On the mobile phone, the offline map package is usually placed on the SD card and then read through the file. For the sake of simplicity, put offline in the Resource Directory of the example and compile it with the application. In actual applications, store these map packages separately. The Guide bee map development kit supports reading multiple map packages at the same time. This is done through the MapTiledZone
declaration is used, the class name should be exactly the same as the file name, that is, "Hellodemo.java" should be used to represent the name of the class.
If the declaration of a class uses class, the class name can be inconsistent with the file name, but execution is de
Beginner's knowledge of JAVA (2) ---- difference between the String class and the StringBuffer class, javastringbuffer
There are two types of String operations in Java: String and StringBuffer (buffer String processing ).The following is a brief description of the differences between the two.Both the String
getting the class type of the array, and the following code is used to get the names of the two arrays of the previous example:
SYSTEM.OUT.PRINTLN ("int arr type name:" +arr.getclass (). GetName ());
System.out.println ("String arr2 type name:" +arr2.getclass (). GetName ());
The results are as follows:
int arr type Name:[i
String arr2 type name:[ljava.lang.string;
As you can see, the array
fields of the static final type
1. Overview
Field table setIs composed of severalField table (field_info). For several fields defined in the classJVMCompileClassAfter the file, the corresponding field information is organized into a structure called the field table set. The field table set is a class array structure, as shown in:
Note: The fields mentioned here refer to static or non-static variables defined in the
slight differences under a classpath and run the test class:
Set classpath =.; % current_root %/V1; % current_root %/v2% Java_home %/bin/Java Test
Figure 3 shows the console output. We can see that the code corresponding to version. FX (1) is executed, because the Class Loader first sees the code of this version in classpath.
Figure 3. samepath test first in the
original variable is changed in the method, and the local inner class is changed, there is no guarantee that the copy is consistent with the original variable (so: they should have been the same variable.)Bottom line: The rule is a helpless one. It also shows that the design of programming language is limited by the implementation technology. This is one example. Because: I see a lot of people hold this vi
, the log records include version. FX (1), while in V2 it is version. FX (2 ). Place the two classes with slight differences under a classpath and run the test class:Set classpath =.; % current_root %/V1; % current_root %/V2% java_home %/bin/Java Test
Figure 3 shows the console output. We can see that the code corresponding to version. FX (1) is executed, because the Class Loader first sees the code of this
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.