Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java GBת UTF 8×Ö·û

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class GB2UTF
{
 public static String GBK2Unicode(String str)
 {
  StringBuffer result = new StringBuffer();
  for (int i = 0; i < str.length(); i++)
  {
   char chr1 = (char)str.charAt(i);
   if(!isNeedConvert(chr1))
   {
    result.append(chr1);
    continue;
   }
   result.append("&#x" + Integer.toHexString((int)chr1) + ";");          
  }
  return result.toString();
 }
 
 public static boolean isNeedConvert(char para)
 {
  return ((para&(0x00FF))!=para);
 }
 
 public static String GBK2Unicode2(String str)
 {
  StringBuffer result = new StringBuffer();
  for (int i = 0; i < str.length(); i++)
  {
   char chr1 = (char)str.charAt(i);
   result.append("&#" + Integer.toString((int)chr1)+ ";"); 
  }        
  return result.toString();
 }
 
 
 public static void main(String[] args)
 {
  try
  {
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   String str = br.readLine();
   System.out.println(GBK2Unicode(str));
   System.out.println(GBK2Unicode2(str));
  }
  catch (IOException e)
  {
   e.printStackTrace();
  }
  
 }
}


Ïà¹ØÎĵµ£º

sql 2005 ´æ´¢¹ý³Ì·ÖÒ³ java ´úÂë

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ ......

JAVA·´Éä»úÖÆÊÂÀý¶þ

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
try {
Class cls = com.lwf.util.CommonUtil.class;
Object obj = cls.newInstance();
Method addMethod = cls.ge ......

java classLoader Ô­Ôò

ÒªÀíÀà¼ÓÔØÌåϵ½á¹¹£¬¾Í±ØÐëÇå³þÈçϼ¸µã±È½Ï»ù±¾µÄÔ­Ôò:
1. classLoaderÊÇÒ»ÖÖ¸¸×ÓÊ÷Ðνṹ£¨×¢£ºÕâÀï²»ÊÇÖ¸Àà¼Ì³ÐµÄ¸¸×Ó¹Øϵ£©
2. ¸¸classLoaderÎÞ·¨¿´µ½×ÓclassLoader¼ÓÔصÄÀà
3¡¢ÐéÄâ»ú×ñÊØË«Ç×ίÍмÓÔØÔ­Ôò£¬¼´ÈκÎ×ÓclassLoaderÐëÊ×ÏÈίÍи¸classLoaderÏȼÓÔØÐèÒªµÄÀ࣬µ±¸¸classLoader¼ÓÔز»µ½Ê±ÔÙÓÉ×ÓclassLoa ......

makefile Ö® java X Ö® lint

E:\>javac -X 
  -Xlint                     ÆôÓý¨ÒéµÄ¾¯¸æ 
  -Xlint:{all,deprecation,unchecked,fallthrough,path,serial,finally,-deprecat ion 
,-unchecked,-fallthrough,-path,-serial,-finally}ÆôÓûò½ûÓÃÌض¨µÄ¾¯¸æ 
& ......

JavaÖÐʹÓÃBigDecimalʵÏÖ¾«È·ÉáÎåÈë¼°¹¤³ÌÔËËã

£¨×¢£ºÇ°ÃæдÁËÒ»¸ö³¬´óÕûÊýÏà¼ÓµÄÀ࣬²Î¼û£º ³¬´óÕûÊýÏà¼Ó£¬³¬¹ýÁËlongµÄ·¶Î§£¬ÄãÒªÔõô×ö£¡£¬ºóÀ´ÓÐÅóÓÑÆÀÂÛ˵BigDecimal¿ÉÒÔÍêȫʵÏÖÎÒµÄÕâÕâ¸ö¹¦ÄÜ£¬¸Õ¿ªÊ¼µÄʱºò£¬ÎÒ»¹²»·þÆø£¬¾ÝÎÒËùÖªÄÇÀïÓÐÕâÑùµÄÀàŶ£¬ºóÀ´±¨×Å˵·þËûµÄÐÄÀíÈ¥ÕÒÁËһϣ¬ºÇºÇ£¬½á¹û¾ÓÈ»×Ô¼º±»Ëµ·þÁË£¬È·ÊµÓÐÕâôһ»ØÊ£¬ÀûÓÃBigDecimal²Ù×÷³¬´óÕûÊýÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ