Java²Ù×÷ÎļþʵÀýÏê½âÓ¦ÓÃ
ÊäÈëÊä³öÁ÷
ÔÚJavaÖУ¬ÎÒÃÇ°ÑÄܹ»¶ÁÈ¡Ò»¸ö×Ö½ÚÐòÁеĶÔÏó³Æ×÷Ò»¸öÊäÈëÁ÷;¶øÎÒÃǰѹ»Ð´Ò»¸ö×Ö½ÚÐòÁгÆ×÷Ò»¸öÊä³öÁ÷¡£ËüÃÇ·Ö±ðÓɳéÏóÀà InputStreamºÍOutputStreamÀà±íʾ¡£ÒòΪÃæÏò×Ö½ÚµÄÁ÷²»·½±ãÓÃÀ´´¦Àí´æ´¢ÎªUnicode£¨Ã¿¸ö×Ö·ûʹÓÃÁ½¸ö×Ö½Ú)µÄÐÅÏ¢¡£ËùÒÔJavaÒýÈëÁËÓÃÀ´´¦ÀíUnicode×Ö·ûµÄÀà²ã´Î£¬ÕâЩÀàÅÉÉú×Ô³éÏóÀàReaderºÍWriter£¬ËüÃÇÓÃÓÚ¶Áд˫×Ö½ÚµÄUnicode×Ö·û£¬¶ø²»Êǵ¥×Ö½Ú×Ö·û¡£
Java.io°ü¼ò½é
JDK±ê×¼°ïÖúÎĵµÊÇÕâÑù½âÊÍJava.io°üµÄ£¬Í¨¹ýÊý¾ÝÁ÷¡¢ÐòÁкÍÎļþϵͳΪϵͳÌṩÊäÈëÊä³ö¡£
InputStreamÀàºÍOutputStreamÀà
InputStreamÀàÊÇËùÓÐÊäÈëÊý¾ÝÁ÷µÄ¸¸À࣬ËüÊÇÒ»¸ö³éÏóÀ࣬¶¨ÒåÁËËùÓÐÊäÈëÊý¾ÝÁ÷¶¼¾ßÓеĹ²Í¨ÌØÐÔ¡£
java.io.InputStreamµÄ·½·¨ÈçÏ£º
public abstract read()throws IOException
¶ÁÈ¡Ò»¸ö×Ö½Ú²¢·µ»Ø¸Ã×Ö½Ú£¬Èç¹ûµ½ÊäÈëÔ´µÄÄ©Ôò·µ»Ø-1¡£Ò»¸ö¾ßÌåµÄÊäÈëÁ÷ÀàÐèÒªÖØÔØ´Ë·½·¨£¬ÒÔÌṩ ÓÐÓõŦÄÜ¡£ÀýÈ磺ÔÚFileInputStreamÀàÖУ¬¸Ã·½·¨´ÓÒ»¸öÎļþ¶ÁÈ¡Ò»¸ö×Ö½Ú¡£
public int read(byte[] b)throws IOException
°ÑÊý¾Ý¶ÁÈëµ½Ò»¸ö×Ö½ÚÊý¾ÝÖУ¬²¢·µ»Øʵ¼Ê¶ÁÈ¡µÄ×Ö½ÚÊýÄ¿¡£Èç¹ûÓöµ½Á÷Ä© Ôò·µ»Ø-1£¬¸Ã·½·¨×î¶à¶ÁÈ¡b.length¸ö×Ö½Ú¡£
public abstract int read(byte[] b,int off,int len)throws IOException
°ÑÊý¾Ý¶ÁÈëµ½Ò»¸ö×Ö½ÚÊý×éÖв¢·µ»Øʵ¼Ê¶ÁÈ¡µÄ×Ö½ÚÊýÄ¿¡£Èç¹ûÓöµ½Á÷µÄĩβÔòµÄ·µ»Ø-1¡£ ÆäÖвÎÊýoff±íʾµÚÒ»¸ö×Ö½ÚÔÚbÖеÄλÖã¬len±íʾ¶ÁÈ¡µÄ×î´ó×Ö½ÚÊý¡£
public long skip(long n)throws IOException
ÂÔ¹ýN¸ö×Ö½Ú²»¶ÁÈ¡£¬»á·µ»Øʵ¼ÊÂÔ¹ýµÄ×Ö½ÚÊýÄ¿¡£ÒòΪÊý¾ÝÁ÷ÖÐʣϵÄÊý¾Ý¿ÉÄܲ»µ½N ¸ö×Ö½ÚÄÇô¶à£¬ËùÒÔ´Ëʱ·µ»ØÖµ»áСÓÚN¡£
public int available()throws IOException
read·½·¨(°üÀ¨ºóÃæÒª½²µÄOutputStreamÀàµÄWrite·½·¨)¶¼Äܹ»ÒõÈûÒ»¸öỊ̈߳¬Ö±µ½×Ö½Ú±» ʵ¼Ê¶ÁÈ¡»òдÈë¡£ÕâÒâζ×ÅÈç¹ûÒ»¸öÁ÷²»ÄÜÁ¢¼´±»¶Á»ò±»Ð´
/*
* Created on 2005-3-10
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package mytestfiles;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
/**
* @author zhangqinglin
* To change the template for this generated type comment
Ïà¹ØÎĵµ£º
JavaỊ̈߳ºÏ̵߳Ľ»»¥
SCJP5ѧϰ±Ê¼Ç
Ï߳̽»»¥ÊDZȽϸ´ÔÓµÄÎÊÌ⣬SCJPÒªÇ󲻺ܻù´¡£º¸ø¶¨Ò»¸ö³¡¾°£¬±àд´úÂëÀ´Ç¡µ±Ê¹Óõȴý¡¢Í¨ÖªºÍ֪ͨËùÓÐÏ̡߳£
Ò»¡¢Ï߳̽»»¥µÄ»ù´¡ÖªÊ¶
SCJPËùÒªÇóµÄÏ߳̽»»¥ÖªÊ¶µãÐèÒª´Ójava.lang.ObjectµÄÀàµÄÈý¸ö·½·¨À´Ñ§Ï°£º
void notify()
......
JavaỊ̈߳ºÐÂÌØÕ÷-×èÈûÕ»
¶ÔÓÚ×èÈûÕ»£¬Óë×èÈû¶ÓÁÐÏàËÆ¡£²»Í¬µãÔÚÓÚÕ»ÊÇ“ºóÈëÏȳö”µÄ½á¹¹£¬Ã¿´Î²Ù×÷µÄÊÇÕ»¶¥£¬¶ø¶ÓÁÐÊÇ“ÏȽøÏȳö”µÄ½á¹¹£¬Ã¿´Î²Ù×÷µÄÊǶÓÁÐÍ·¡£
ÕâÀïÒªÌرð˵Ã÷Ò»µãµÄÊÇ£¬×èÈûÕ»ÊÇJava6µÄÐÂÌØÕ÷¡£¡¢
JavaΪ×èÈûÕ»¶¨ÒåÁ˽ӿڣºjava.util.concurrent.Block ......
JavaỊ̈߳ºÐÂÌØÕ÷-Ô×ÓÁ¿
ËùνµÄÔ×ÓÁ¿¼´²Ù×÷±äÁ¿µÄ²Ù×÷ÊÇ“Ô×ӵĔ£¬¸Ã²Ù×÷²»¿ÉÔÙ·Ö£¬Òò´ËÊÇḬ̈߳²È«µÄ¡£
ΪºÎҪʹÓÃÔ×Ó±äÁ¿ÄØ£¬ÔÒòÊǶà¸öÏ̶߳Ե¥¸ö±äÁ¿²Ù×÷Ò²»áÒýÆðһЩÎÊÌâ¡£ÔÚJava5֮ǰ£¬¿ÉÒÔͨ¹ývolatile¡¢synchronized¹Ø¼ü×ÖÀ´½â¾ö²¢·¢·ÃÎʵݲȫÎÊÌ⣬µ«ÕâÑùÌ«Âé·³¡£
Java5Ö®ºó£¬× ......
JavaỊ̈߳ºÐÂÌØÕ÷-ÕÏ°Æ÷
Java5ÖУ¬Ìí¼ÓÁËÕÏ°Æ÷À࣬ΪÁËÊÊÓ¦Ò»ÖÖеÄÉè¼ÆÐèÇ󣬱ÈÈçÒ»¸ö´óÐ͵ÄÈÎÎñ£¬³£³£ÐèÒª·ÖÅäºÃ¶à×ÓÈÎÎñÈ¥Ö´ÐУ¬Ö»Óе±ËùÓÐ×ÓÈÎÎñ¶¼Ö´ÐÐÍê³Éʱºò£¬²ÅÄÜÖ´ÐÐÖ÷ÈÎÎñ£¬Õâʱºò£¬¾Í¿ÉÒÔÑ¡ÔñÕÏ°Æ÷ÁË¡£
ÕÏ°Æ÷ÊǶàÏ̲߳¢·¢¿ØÖƵÄÒ»ÖÖÊֶΣ¬Ó÷¨ºÜ¼òµ¥¡£ÏÂÃæ¸ø¸öÀý×Ó£º
import jav ......
°æȨÉùÃ÷£º×ªÔØʱÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://as112255.blogbus.com/logs/38662785.html
package com.softeem.jbs.lesson4;
import java.util.Random;
/**
* ÅÅÐò²âÊÔÀà
*
* ÅÅÐòËã·¨µÄ·ÖÀàÈçÏ£º
* 1.²åÈëÅÅÐò£¨Ö±½Ó²åÈëÅÅÐò¡¢ÕÛ°ë²åÈëÅÅÐ ......