Java×Ö·û´®Óë×Ö·û¼¯µÄ»ù±¾¸ÅÄî
±¾×÷Æ·²ÉÓÃ֪ʶ¹²ÏíÊðÃû-·ÇÉÌÒµÐÔʹÓÃ-Ïàͬ·½Ê½¹²Ïí 2.5 Öйú´ó½Ðí¿ÉÐÒé½øÐÐÐí¿É¡£
Java StringÊÇJava APIÖÐ×î³£ÓõÄÀ࣬±¾Îĺʹó¼Ò̸̸StringÀàµÄÄÚ²¿ÔÀí£¬Í¬Ê±ÃèÊöISO-8859-1×Ö·û¼¯ÔÚ×Ö·û´®´¦ÀíÖеĶÀÌØÓô¦¡£
Java×Ö·û´®µÄÄÚ²¿±àÂë
StringÀàÄÚ²¿¹ÜÀí×ÅÒ»¸öcharÀàÐ͵ÄÊý×飬Java APIÊÇÕâÑùÃèÊöchar»ù±¾ÀàÐ͵ģº
char Êý¾ÝÀàÐÍ£¨ºÍ Character ¶ÔÏó·â×°µÄÖµ£©»ùÓÚÔʼµÄ Unicode ¹æ·¶£¬½«×Ö·û¶¨ÒåΪ¹Ì¶¨¿í¶ÈµÄ 16 λʵÌå¡£
ÕâÒ»µãÎÒÃÇ¿ÉÒÔͨ¹ýÏÂÃæµÄÓï¾ä¼ÓÒÔ֤ʵ£º
System.out.println(Character.SIZE); // ½á¹ûΪ16
¸ù¾ÝStringÀàµÄ¹¹Ôì·½·¨£¬ÎÒÃÇ¿ÉÒÔÕâÑù¶¨Òå×Ö·û´®£º
String str = "abc";
ÉϾä´úÂëµÈЧÓÚ£º
char data[] = {'a', 'b', 'c'};
String str = new String(data);
ͬʱ£¬char»ù±¾ÀàÐÍÓëbyte¡¢short¡¢int¡¢longÒ»Ñù¿ÉÒÔÓÃÊýÖµ±íʾ¡£ËùÒÔÉÏÊö´úÂëµÈЧÓÚ£º
char data[] = {0x61, 0x62, 0x63};
String str = new String(data);
ÐèҪעÒâµÄÊÇ£¬char»ù±¾ÀàÐÍʼÖÕʹÓÃ16λ¼´Á½¸ö×Ö½Ú±íʾһ¸ö×Ö·û£¬¼´Ê¹Õâ¸ö×Ö·ûµÄUnicodeֵСÓÚ0xFF£¨ÈçASCIIÂ룩¡£¶ÔÓÚUnicodeÖµ´óÓÚ0xFFµÄ×Ö·û£¬Èç“Öйú”¶þ×ÖµÄUnicode±àÂë·Ö±ðΪ\u4E2DºÍ\u56FD£¬ÎÒÃÇ¿ÉÒÔÕâÑù´´½¨£º
char data[] = {'\u4E2D', '\u56FD'};
String str = new String(data);
µ±È»Ò²¿ÉÒÔÕâÑù´´½¨£º
char data[] = {0x4E2D, 0x56FD};
String str = new String(data);
ͨ¹ýÉÏÃæµÄÃèÊö¿ÉÒÔÃ÷È·Á½¸öÒªµã£º
×Ö·û´®¶ÔÏóÖеÄÿһ¸öÔªËØʼÖÕÕ¼¾ÝÁ½¸ö×Ö½Ú³¤¶È£¬Ò»¸ö»òÁ½¸öÔªËØ£¨Ôö²¹×Ö·ûÕ¼¾ÝÁ½¸öÔªËØ£©±íʾһ¸ö×Ö·û¡£
×Ö·û´®¶ÔÏóÖеÄÿһ¸öÔªËض¼Ê¹ÓÃUnicode×Ö·û¼¯½øÐбàÂë¡£
×Ö·û¼¯£¨Charset£©Óë×Ö½Ú»¯×Ö·ûÊý¾Ý
ÔÚ³öÏÖ Unicode ¹æ·¶Ö®Ç°£¬¼ÆËã»úÔÚ´¦Àí×Ö·û´®µÄÎÊÌâÉϾÀú¹ýASCIIºÍANSI±àÂëÁ½¸ö½×¶Î£¬ÔÚASCIIʱ´ú£¬¼ÆËã»úÖ»ÄÜ´¦ÀíÓ¢ÎÄÊý×ÖÒÔ¼°¼¸¸ö»ù±¾·ûºÅ£¬µ±Ê±Ê¹ÓõÄÊǵ¥×Ö½Ú×Ö·û¼¯£¨SBCS£©¡£
¸÷¹úΪÁËÄÜÔÚ¼ÆËã»úÉÏ´¦Àí±¾¹úµÄÎÄ×Ö£¬Öƶ©ÁËÏàÓ¦µÄ¹ú¼Ò±ê×¼£¬¹æ¶¨Á˸÷×ÔµÄANSI±àÂë¡£ÈçÖÐÎļòÌåʹÓÃGBK±ê×¼£»ÖÐÎÄ·±ÌåʹÓÃBIG5±ê×¼£»ÈÕÎÄʹÓÃShift_JIS±ê×¼¡£ÔÚANSI±àÂëʱ´ú£¬¼ÆËã»úʹÓöà×Ö½Ú×Ö·û¼¯£¨MBCS£©´¦ÀíÎÄ×Ö¡£Èç“ÖйúABC”£¬ÔÚGB2312±ê×¼ÖУ¬“Öйú”Á½¸ö×Ö·û·Ö±ðʹÓÃÁ½¸ö×Ö½Ú±íʾ£¬¶ø“ABC”Èý¸öÓ¢ÎÄ×Ö·ûÓÖ·Ö±ðʹÓÃÒ»¸ö×Ö½Ú±íʾ¡£¸÷¹úÎÄ×ÖµÄANSI±àÂ뻥²»Í¨Ó㬲»ÄÜʹÓÃÒ»ÖÖANSI±àÂë±í´ï¶à¸ö¹ú¼ÒµÄÎÄ×Ö¡£
ΪÁËÎ
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
·ÖÎå¸ö²¿·Ö ÎÒ¶ÔËûÃÇ´ò°üÁË ¿ÉÒÔ»¥Ïàµ÷ÓÃ
Ö÷º¯Êý²¿·Ö£º
eightnum.javaÎļþ£º
package com.ai;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
import java.applet.*;
import javax.swing.*;
public class EightNum {
int[][] current;
int[][] target;
priv ......
ÔÚjavaÖУ¬ËùÓжÔÏó¶¼ÓÐtoString()Õâ¸ö·½·¨£¬ÒòΪËüÊÇObjectÀïÃæÒѾÓÐÁ˵ķ½·¨£¬¶øËùÓÐÀ඼ÊǼ̳ÐObject£¬ËùÒÔ“ËùÓжÔÏó¶¼ÓÐÕâ¸ö·½·¨” ¡£Ëüͨ³£Ö»ÊÇΪÁË·½±ãÊä³ö£¬±ÈÈçSystem.out.println(xx)£¬À¨ºÅÀïÃæµÄ“xx”Èç¹û²»ÊÇStringÀàÐ͵Ļ°£¬¾Í×Ô¶¯µ÷ÓÃxxµÄtoString()·½ ......
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* @author new
*
*/
public class ReadDataTest
{
/**
* @param args
*/
String url="D:/java.txt";
String str="";
char[] ch=new char[1024];
StringBuffer sb=new ......
JavaScriptÓïÑÔºÍJavaÓïÑÔÊÇÏà¹ØµÄ£¬µ«ËüÃÇÖ®¼äµÄÁªÏµ²¢²»ÏñÏëÏóÖеÄÄÇÑù½ôÃÜ¡£
¡¡¡¡ ¶þÕßµÄÇø±ðÌåÏÖÔÚ£º
¡¡¡¡ Ê×ÏÈ£¬ËüÃÇÊÇÁ½¸ö¹«Ë¾¿ª·¢µÄ²»Í¬µÄÁ½¸ö²úÆ·£¬JavaÊÇSUN¹«Ë¾ÍƳöµÄÐÂÒ»´úÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼ÆÓïÑÔ£¬ÌرðÊʺÏÓÚInternetÓ¦ÓóÌÐò¿ª·¢£»¶øJavaScrip ......