1. java.util.Formatter:
util class for System.out.printf method
2. variable naming convention
internal variable had better start with '_'.
3. Array Util
> System.arrayCopy(src, startIndex, dest, startIndex, length);
> Arrays.sort(Array)
Arrays.binarySearch();
Arrays.equal(array1, array2)
Arrays.deepEquals(array1,array2);
4. StringBuilder is used in un-synchronized programme.
StringBuffer will take care of itself in multithread programme
5. LinkedList(JDK5) implements java.util.Queue
6. RandomAccessFile: aims to read/write file randomly.
Notice: the mode in reading has to be set.<"rw"...>
7. InputStream/OutputStream <byte stream>
---- FileInputStream/FileOutputStream
---------BufferedInputStream/BufferedOutputStream<8192 maxlength>
---------DataInputStream/DataOutputStream
---------ObjectInputStream/ObjectOutputStream
---------SequenceInputStream: split or concat the input streams together
---------PrintStream: aims to write back to the destination follwoing the orginal system
---------ByteArrayInputStream/ByteArrayOutputStream: treat the byte array as the destination or source
---------PushbackInputStream: hold a buffer area in the memory in which the data can be put back
8. Reader/Writer: Character Stream
----InputStreamReader/OutputStreamWriter: <inputStream/OutputStream Entry Parameter>
---------FileReader/FileWriter:
---------BufferedReader/BufferedWriter: <8192 maxlength>
---------PrintWriter: similar functions above
---------CharArrayReader/CharArrayWriter:
---------PushbckReader:
9. ThreadA.join() make the subject thread get done before the caller thread.
Thread.interrupted() mainly tries to break the thread in the sleep.
10. ThreadExceptionHandler:-> Thread.setUncaughtExceptionHandler(handler); This class will handle the class exception.
11. wait(time): thread wait for the certain time, if it is expired, the thread will be put back to the wait pool in the Block
Status;
12. java.util.concurrent.BlockingQueue: form a structure for the synchronized operation.
LinkedBlockingQueue, ArrayBlockingQueue,PriorityBlockingQueue.
13. Callable Object: a thread interface to return a result
FutureTask(Callable/Runnable)--> Thread(FutureTask) ? FutureTask.isDone? ===> implements the features.
--- Proxy Pattern in some way
14. java.util.Excutors: provide the quick way to create the Thread Pool.
---- newCachedThreadPool(60s idle),
---- newFixedThreadPool();
----- newSingleThreadExecutor()
----- newScheduleThreadPool()
----- newSingleThreadScheduledExecutor()
15. Reflection:
class.forName(ClassName, isInitialized, Thread.currentThread().getContextClassLoader())=> load class dynamically
Array.newInstance(ArrayElement.class, ArrayLength); ==> try to create an array
16. Annotation: Code reference, reference of reference
-----Basic: Override, Deprectated, @SuppressWarnings
-----User Customized Annoation.
-----Annotation to Annotation...
17. MessageFormat: mainly parse the variable information in the Properties.
18. System.getProperty("line.separator): retrieve the line seperator symbol
19. jar compressing process:
command line: jar cvf ./bin/xxx.jar -C source_dir
create a file named manifest.txt adding "Main-Class: classpath.mainclasss" + /n
20. Properties Usage
Properties() -> obj.load(new FileInputStream(configfile)) --> obj.getProperty("")
21:
JDK 5 New Features:
* String.isEmpty(): identitfy the string is "" or not.
* Arrays.copyOf(arr1,length) -->new Array
* java.io.Console.readLine(): support the direct recipt of the input message.