The ClassLoader is responsible for loading the. class file (possibly on disk, possibly on the network) into memory and generating the corresponding Java.lang.class object for it.Introduction of Class LoaderOnce a class is loaded by the ClassLoader to generate an java.lang.class instance in memory, the same class is no longer loaded.Unique identity of the class: In the Java language, a class is uniquely identified with its fully qualified name, but in
)
Data type conversions
A solid arrow in the diagram indicates a loss-free conversion, and a dashed arrow indicates a conversion that may have a loss of precision. (e.g. 123 456 789 (int) is a large integer that contains more bits than can be expressed by the float type (a valid number 6~7 bit), and when this integer value is converted to float, the result is the same size, But the loss of a certain degree of accuracy (after the number of decimals can not be ac
Over the last one months. Just swallowed the book over. The book is long enough to say 706 pages. I have never been a person who likes to record, have been reading what books have been read to throw aside, may sometimes have so a little want to record down the impulse, but the calculation time is too tight, a lot of youshiwuzhong, after all, research and research program is only a hobby of their own, but did not expect to sign a programmer's work. Alas, this God is too much fun, let a study of e
/dopost-destroy destroy)The difference between > and CGI is that the servlet is in a server process, it runs its service methods in a multithreaded manner, an instance can serve multiple requests, and its instances are generally not destroyed, and CGI generates a new process for each request, which is destroyed after the service is completed. So the efficiency is lower than the servlet.(servlet: Server process, multithreaded run service, one instance service multiple requests, not normally destr
throws interrupterexception{ Sleep (delay);}10.synchronized keywords Public synchronized Voi Method () { method body}Equivalent to Public void method () { this. Intrinsiclock.lock (); Try { method body }finally{ this. Intrinsiclock.unlock ( ); }}11. Use Object Lock public class bank{ public void transfer (int from, int to, int mount) { synchronized -=amount; Accounts[to] +=amount; } System.out.println (...); private double [] Account; p
As a business developer, there are few technologies that can be used at work. Although usually always say what, multi-threading, concurrency, injection, Attack! But in practical work, these things are not necessarily used. Because the framework we used has already done that.For example, web development, there are a lot of requests coming in, supposedly, we should consider concurrency problems. But in fact, Spring receives the request, after assigning to the controller, it is already thread-safe,
servletcontext =this.getservletcontext ();(commonly used)The role of ServletContext(1) Get the global initialization parameters of the Web applicationConfiguring initialization parameters in Web. xmlGet parameters from the context object(2) get the absolute path to any resource in the Web AppString path =context.getrealpath (relative to the Web app's relative address);Create a file a.txt under WebContent, create a b.txt under Web-inf, create a c.txt under SRC, and when the relative path is pass
interface reference, because the dynamic agent of Java actually uses the incoming interface type to create a new class, so the hero type cannot be used to point to the created object in the code above. Can only be pointed to by the person or fightable type. Look at the source code can find this point.Second, the AOP agentOne way to implement AOP (aspect-oriented programming) is to use a Java dynamic proxy.
Java's core API is very large, which gives developers a lot of convenience, often people have comments, Java makes programmers dull.
But some content I think is must grasp, otherwise can not skillfully use Java, also will not use "just silly". 1, under the Java.lang package of more than 80% of the functions of the flexible use of the class.
2, Java.util package
The more efficient Java threads have always been, and then know the efficiency of execution and CPU core number, today we tried the multi-core CPU under multithreading calculation:
This machine i5 four cores, opens 1, 4, 10, 20, 40, 100, 400 threads to do 100W times respectively, the result is as follows:
All tasks completed, total time consuming: 38368ms,thr
. 245 page71 Video 8.6 Viewer mode for linkage Scenarios 8.4.3 page No. 25172 Video 8.7 Applying a dependency reversal principle can reduce the range of changes affected 8.5.1 No. 254 page73 Video 8.8 A single responsibility principle that can keep classes as stable as possible 8.5.2 No. 256 page74 Video 8.9 The Richter replacement principle to follow when inheriting 8.5.3 No. 257 page75 Video 8.10 Optimizing inherited usage scenarios by using the synthetic Multiplexing Principle page No. 261 of
Lambda An expressionform: parameter, arrow (-), expressionParameter type to write, if you can deduce it can not writeOnly one argument can omit parenthesesNo arguments to write empty brackets ()* If the branch returns a value, then all branches will return a value, otherwise it is illegalfunction interface: interface with only one abstract method (can be marked with @functionalinterface annotations)For example, you can do this in Javax.swing.Timer. Timer T = new timer (+, event-{...});The s
For this code, a lot of netizens are full of questions, first there are many, not careful, did not write the pair class, to compile.Certainly compiled, the pair class is on the first two pages of the other code.And here, the features of generics are written. By several constructors, and the change of parameters, the generic type is explained.Package pair1;public class pairPrivate T first;Private T second;Public Pair () {first = null;second = null;}Public Pair (t first, t second) {This.first = Fi
Why is the use of volatile lower than the cost of synchronization?
The cost of synchronization is mainly determined by its coverage, and if you can reduce the coverage of synchronization, you can significantly improve program performance.
And volatile's coverage is variable-level only. Therefore, its synchronization cost is very low.
What is the volatile principle?
Volatile's semantics, in fact, is to tell the processor, do not put me into working memory, please directly in main memory opera
schematic, the inside of the compiler is certainly not outer An implicit reference to an external class is set in the constructor. The compiler modifies all constructors for the inner class, adding a parameter that references the external class. Even if you do not define a constructor for an inner class, the compiler generates a default constructor for the inner class. such as:Publictimeprinter (talkingclock clock) {outer = clock;}When an inner class object is created in the Start method, th
1. ExceptionsThe user wants the program to take some sensible action in the event of an error. If some operations cannot be completed due to an error, the program should: return to a security state and be able to make some other commands, or allow the results of all operations to be saved and terminate the program in an appropriate manner.Exception handling tasks: Transfer control from where the error occurred to an error handler that can handle the situation.Exception Categories: Throwable:erro
The book is generally finished, but the seventh chapter is not in a hurry to end.But fortunately it is finished, barely count it.Recall this year, quite feeling, the heart has been seeking progress, but it is very difficult to act up.Think about it indeed ah, want to always progress must sacrifice their spare time, although not to exclude learning, but you have to admit that the feeling of paralysis is very good.Man, there's really nothing to stop, and once you get down, you're probably going to
JSTL Core Tag Library has a total of 13 tags, functionally divided into 4 categories:
1. Expression control Tags: out, set, remove, catch
2. Process Control Tag: If, choose, when, otherwise
3. Cyclic Tags: forEach, fortokens
4.URL operation tag: import, URL, redirect
When using labels, be sure to include the following code in the header of the JSP file:
These labels are described in the following sections:
1.
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.