JAVA core technology Volume 1, generic example, java Core Technology example
For this Code, many netizens are full of questions. First of all, there are a lot of questions. If you don't write the Pair class, you can compile it.
Th
[Java core technology volume I (the ninth edition of the original book)] Chapter 1 collection, the ninth edition of core technology
This chapter describes how to use the Java class library to help us implement the traditional dat
, it can be embedded, based on the class set that is currently loaded. If necessary, you can also undo the optimization.Multithreading : Multithreading brings better interactive response and real-time behavior. Multithreaded compilation is simple.Dynamic : Dynamic is important when some code is added to a running program. The current version of Java allows programmers to know the structure and behavior of objects. It is useful for systems that must pa
Now that we are in the 21st century, it is hard to imagine that Java-related books are so scarce, but this is just the case with Java. All the Java-related books were basically published by several Sun engineers, such as the "Hooked on Java" written by Arthur Van Hoff et.al and "The
called and passed to it with the methods object and the original invocation parameters. The calling processor must give a way to call processing.To create a proxy object, you need to use the Newproxyinstance method of the proxy class, which has three parameters:1: Class loader. As part of the Java security model, for system classes and from other classes, you can use a different classloader, currently usin
Download address: Network disk download
Introduction to the content
One of the most influential and valuable works in the Java field, with more than 20 years of experience in teaching and research of senior Java technology experts to write (won the Jolt Award), and "Java Programming ideas," the same as the more than 10-year global best-selling not decline, popul
class does not have a way to modify the strings, if you really want to change them
The following expressions are legal
The = = operator detects whether two strings are placed in the same position
In fact, only string constants are shared, and the results of operations such as + or substring are not shared
Issupplementarycodepoint (int codepoint) is a Boolean method of the character class that determines whether the specified character (Unicode code point) i
Interneta Short history of Javacommon misconceptions about JAVACHAPTE R 2 the Java Programming Environment (new comments Total 20) Chapter 3 fundamental programming structures in Java (new comments Total 44) Chapter 4 Obje CTS and Classes (new comments Total 55) Chapter 5 Inheritance (new comments Total 42) Chapter 6 Interfaces and Inner Classes (new comments Total 24) Chapter 7 Excepti ONS, Logging, asser
Basic data typesJava is the language of a strong data classThere are 8 basic data types, including:Integer 4 types Int (4 bytes) short (2 bytes) long (8 bytes) byte (1 bytes)The range and machine-independent lengths of integers in Java are certain, and do not cause integer overflow across platformsFloat type two double floatThe length of the double is twice times the length of the float, the double value bu
List 13.1 Linklist/linkedlisttest.javaLinklist of Java ContainersPackage Linklist;import Java.util.linkedlist;import Java.util.list;import Java.util.listiterator;public class Linklisttest{public static void Main (String args[]) {list Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. Java Core Technology
.
Boolean replace (K key,v oldvalue,v newvalue)
If the given key is currently associated with oldvalue, it is associated with the newvalue. otherwise returns falseCopy of the Write arraycopyonwritearraylist and Copyonwritearrayset are thread-safe collections. all of the modified threads replicate the underlying array. This arrangement is useful if the number of threads iterating over the collection exceeds the number of modified threads. When constructing an iterator, it contains a
for another thread to notify the scheduler of a condition, it enters its own wait state. This occurs when you call the Object.wait method or the Thread.Join method, or you wait for lock or condition in the Java.util.concurrent library.
Timed Waiting (timed Wait)
There are several methods that have a timeout parameter. Calling them causes the thread to enter a timed wait (time waiting) state. This status will be maintained until the timeout expires or the appropriate notification i
Java core technology volume I Basic Knowledge (7), java Core TechnologyChapter 1 Set
Set Interface
Specific set
In a table, except for Classes ending with Map, other classes implement the Collection interface, wh
classes and packages:java -ea:... -da:MyClass MyAppYou cannot apply a system class that does not have a classloader, to use:-enablesystemassertions/-esaUsing assertions to complete parameter checkingUse the assertion scenario:
Assertion failure is a fatal, unrecoverable error
Assertions for development and test phases
Non-notification of recoverability errors should not be used as a means of informing users of problems.This method is not allowed to be called with a null array,
complete most functions of the field****************An iterator is a design pattern that is an object that can traverse and select objects in a sequence, and the developer does not need to know the underlying structure of the sequence . Iterators are often referred to as "lightweight" objects because they are less expensive to create.The iterator functionality in Java is relatively simple and can only be moved one way:(
execution path; the so-called execution path refers to the directory list where the operating system searches for a local executable file.The same level directory in Jdk\bin contains the Src.zip file, which is the source code for all public classesGet more source code (compilers, virtual machines, local methods, and private helper classes, etc.) with access to: Oracle.net.Here is the anatomy of the JDK section:The difference between the JDK and the JRE can be seen clearly:There are three types
simple test, that is, do not use the exception to do the program to determine the branch; 2) to properly use the exception hierarchy, throw or capture, to try to use a class that can express a specific purpose, which will have better readability, Do not use throwable at all times, so that the readability is poor, 3) in the detection of errors, "harsh" than laissez-faire better, such as Stack.pop () is the return of NULL better or run out emptystackexception better? The author thinks the latter
IncreaseDeleteThe Remove method allows you to delete a specified element.Find*************************************************HashSet can neither use the index of 0 1 2 3 to determine the value of an element, nor use key to determine the value of an element*********************HashSet like this ["AA", "BB"] grow into such a data structure******************HashMap grow into such {a=123, B=hello}Jsonobject very much like {"A": 123, "B": null}
each other.Synchronization queueA synchronization queue is a mechanism for pairing producers with consumer threads. When a thread calls the Put method of synchronousqueue, it blocks until another thread calls the Take method, and vice versa. Unlike Exchanger's case, data travels only in one direction, from producers to consumers. Even though the Synchronousqueue class implements the Blockingqueue interface, conceptually it is still not a queue. It does not contain any elements, and its size met
InstantiationException, IllegalAccessException { returnnew PairnewInstance(), c.newInstance());}CallmakePair(Employee.class);The type parameter T matches the Employee.Generic type information in a virtual machineYou can use the reflection API to determine:
This generic method has a type parameter called T.
This type parameter has a subclass qualification, which is itself a generic type.
This qualified type has a wildcard parameter.
This wildcard parameter has a superclas
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.