jdk学习笔记

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值