javaÖÐÊäÈëÊä³öµÄ×ÜÀ¨(³õѧ±Ø¿´)
µÚÒ»½Ú Êý¾ÝÁ÷µÄ»ù±¾¸ÅÄî
Àí½âÊý¾ÝÁ÷
Á÷Ò»°ã·ÖΪÊäÈëÁ÷£¨Input Stream£©ºÍÊä³öÁ÷£¨Output Stream£©Á½À࣬µ«ÕâÖÖ»®·Ö²¢²»ÊǾø¶ÔµÄ¡£±ÈÈçÒ»¸öÎļþ£¬µ±ÏòÆäÖÐдÊý¾Ýʱ£¬Ëü¾ÍÊÇÒ»¸öÊä³öÁ÷£»µ±´ÓÆäÖжÁÈ¡Êý¾Ýʱ£¬Ëü¾ÍÊÇÒ»¸öÊäÈëÁ÷¡£µ±È»£¬¼üÅÌÖ»ÊÇÒ»¸öÊýÈËÁ÷£¬¶øÆÁÄ»ÔòÖ»ÊÇÒ»¸öÊä³öÁ÷¡£
JavaµÄ±ê×¼Êý¾ÝÁ÷
±ê×¼ÊäÈëÊä³öÖ¸ÔÚ×Ö·û·½Ê½Ï£¨ÈçDOS£©£¬³ÌÐòÓëϵͳ½øÐн»»¥µÄ·½Ê½£¬·ÖΪÈýÖÖ£º
±ê×¼ÊäÈëstudin,¶ÔÏóÊǼüÅÌ¡£
±ê×¼Êä³östdout,¶ÔÏóÊÇÆÁÄ»¡£
±ê×¼´íÎóÊä³östderr,¶ÔÏóÒ²ÊÇÆÁÄ»¡£
Àý 8.1 ´Ó¼üÅÌÊäÈë×Ö·û¡£
±¾ÀýÓÃSystem.in.read(buffer)´Ó¼üÅÌÊäÈëÒ»ÐÐ×Ö·û£¬´æ´¢ÔÚ»º³åÇøbufferÖУ¬count±£´æʵ¼Ê¶ÁÈëµÄ×Ö½Ú¸öÊý£¬ÔÙÒÔÕûÊýºÍ×Ö·ûÁ½ÖÖ·½Ê½Êä³öbufferÖеÄÖµ¡£Read·½·¨ÔÚjava.io°üÖУ¬¶øÇÒÒªÅ׳öIOExceptionÒì³£¡£³ÌÐòÈçÏ£º
import java.io.*;
public class Input1
{
public static void main(String args[]) throws IOException
{
System.out.println("Input: ");
byte buffer[] = new byte[512]; //ÊäÈ뻺³åÇø
int count = System.in.read(buffer); //¶ÁÈ¡±ê×¼ÊäÈëÁ÷
System.out.println("Output: ");
for (int i=0;i<COUNT;I++) Êä³öbufferÔªËØÖµ
{
System.out.print(" "+buffer[i]);
}
System.out.println();
for (int i=0;i<COUNT;I++) °´×Ö·û·½Ê½Êä³öbuffer
{
System.out.print((char) buffer[i]);
}
System.out.println("count = "+ count); //bufferʵ¼Ê³¤¶È
}
}
³ÌÐòÖУ¬main·½·¨²ÉÓÃthrows×Ó¾äÅ׳öIOExceptionÒì³£½»ÓÉϵͳ´¦Àí¡£
Java.io°üÖеÄÊý¾ÝÁ÷¼°ÎļþÀà
×Ö½ÚÁ÷£º
¡¡¡¡´ÓInputStreamºÍOutputStreamÅÉÉú³öÀ´µÄһϵÁÐÀà¡£ÕâÀàÁ÷ÒÔ×Ö½Ú(byte)Ϊ»ù±¾´¦Àíµ¥Î»¡£
InputStream¡¢OutputStream
¡ó FileInputStream¡¢FileOutputStream
¡ó PipedInputStream¡¢PipedOutputStream
¡ó ByteArrayInputStream¡¢ByteArrayOutputStream
¡ó FilterInputStream¡¢FilterOutputStream
¡ó DataInputStream¡¢DataOutputStream
&
Ïà¹ØÎĵµ£º
ÎÊÌâÃèÊö
Exception in thread "main" java.lang.OutOfMemoryError:
Java heap space
½â¾ö·½°¸[ת]
Ò»Ö±¶¼ÖªµÀ¿ÉÒÔÉèÖÃjvm heap´óС£¬Ò»Ö±ÓÃeclipseд/µ÷ÊÔjava³ÌÐò¡£Ò»Ö±ÓÃÃüÁîÐÐor
console¼Ó²ÎÊýÅܳÌÐò¡£ÏÖÏó£ºÔÚeclipseµÄÅäÖÃÎļþeclipse.iniÖÐÉèÖÃ-vmargs -Xms500m
-Xmx1024m
£¬ÔÚeclipseÖ ......
¶ÔÓÚ10½øÖÆÊýת»»ÎªN£¨2-36£©½øÖÆÒ»°ã¶¼ÊÇÑ¡ÔñÈ¡Óà³ýµÄËã·¨½øÐÐת»» £¬ÏÂÃæ¸ø³öÁ½ÖÖ·½°¸
Ò»ÖÖÊǵݹ飬һÖÖÊǵü´ú¡£Í¨¹ýЧÂÊÆÀ¼ÛÁ½ÕßÐÔÄÜ
ÆäÖеü´úµÄ·½°¸Ö±½ÓÈ¡×ÔjavaÔ´´úÂë¡£
/*
*Class NotationConvert.java
*Create Date: 2009-11-12
*Author:a276202460
*/
package com.rich.notation;
public class Notat ......
Java ¶àÏ̱߳à³ÌÖ®Èý£ºsynchronized ¹Ø¼ü×ÖµÄʹÓÃ
´øÓÐ synchronized ¹Ø¼ü×ֵķ½·¨´ú±íÕâ¸ö·½·¨¼ÓËø¡£Ç¡µ±¶øÓÖÁé»îµØÔËÓà synchronized ¹Ø¼ü×Ö£¬ÊǶàÏ̱߳à³ÌµÄ±ØÐ޿Ρ£
¡¡¡¡1¡¢synchronized¹Ø¼ü×ÖµÄ×÷ÓÃÓòÓжþÖÖ£º
¡¡¡¡1£©ÊÇij¸ö¶ÔÏóʵÀýÄÚ£¬synchronized aMethod(){}¿ÉÒÔ·ÀÖ¹¶à ......
JavaÊÂÎñAPI£¨JTA£»Java Transaction API£©ºÍËüµÄͬ°ûJavaÊÂÎñ·þÎñ(JTS£»Java TransactionService)£¬ÎªJ2EEƽ̨ÌṩÁË·Ö²¼Ê½ÊÂÎñ·þÎñ¡£Ò»¸ö·Ö²¼Ê½ÊÂÎñ£¨distributedtransaction£©°üÀ¨Ò»¸öÊÂÎñ¹ÜÀíÆ÷£¨transaction manager£©ºÍÒ»¸ö»ò¶à¸ö×ÊÔ´¹ÜÀíÆ÷(resource manager)¡£Ò»¸ö×ÊÔ´¹ÜÀíÆ÷£¨resource manager£©ÊÇÈÎÒâÀàÐ͵ ......