javaʵÏÖÊä³ö×Ö·û´®ÖеÄÊý×Ö×Ö·û
package com.joe;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Test
{
//½«×Ö·û´®µÄÊý×Ö×Ö·ûÊä³ö
public static void main(String[] args)
{
String str = "iu7i8hy4jnb2";
//·½·¨Ò»
String vString = str.replaceAll("[\\D]", ""); // [\D] == [^\d] == [^0-9]
System.out.println(vString);
//·½·¨¶þ
String regex = "\\d";
Matcher m = Pattern.compile(regex).matcher(str);
while(m.find())
{
System.out.print(m.group());
}
System.out.println();
}
}
Ïà¹ØÎĵµ£º
public£¨¹«¹²·ÃÎÊ¿ØÖÆ£©£º¿ÉÒÔ±»ËùÓÐÀà·ÃÎÊ¡£
protected£¨±£»¤·ÃÎÊ¿ØÖÆ£©£º¿ÉÒÔ±»Õâ¸öÀà±¾Éí¡¢ËüµÄ×ÓÀࣨ°üÀ¨Í¬Ò»¸ö°üÖÐÒÔ¼°²»Í¬°üÖеÄ×ÓÀࣩºÍͬһ¸ö°üÖеÄËùÓÐÆäËûÀà·ÃÎÊ¡£
default£¨ÓѺ÷ÃÎÊ¿ØÖÆ£©£º¿ÉÒÔ±»Õâ¸öÀà±¾ÉíºÍͬһ¸ö°üÖÐµÄÆäËûÀàËù·ÃÎÊ¡£
private£¨Ë½ÓзÃÎÊ¿ØÖÆ£©£ºÖ»Äܱ»¸ÃÀà×ÔÉí·ÃÎʺÍÐ޸ġ£ ......
½«JavaÓ¦ÓóÌÐò±¾µØ±àÒëΪEXEµÄ¼¸ÖÖ·½·¨(ÍÆ¼öʹÓÃJOVEºÍJET)
1. ´Ówww.towerj.com»ñµÃÒ»¸öTowerJ±àÒëÆ÷£¬¸Ã±àÒëÆ÷¿ÉÒÔ½«ÄãµÄCLASSÎļþ
±àÒë³ÉEXEÎļþ¡£
2. ÀûÓÃ΢ÈíµÄSDK-Java 4.0ËùÌṩµÄjexegen.exe´´½¨EXEÎļþ£¬Õâ¸öÈí¼þ¿ÉÒÔ
´Ó΢ÈíµÄÍøÕ¾Ãâ·ÑÏÂÔØ£¬µØÖ·ÈçÏ£º
ht ......
Java±à³ÌÄÇЩʶù84——IO¼ò½é
I/O´¦Àí¼¼ÊõÊÇJavaÓïÑÔÖÐʵÏÖÎļþ²Ù×÷¡¢ÄÚ´æ²Ù×÷¡¢¿ØÖÆÌ¨ÊäÈëÒÔ¼°ÍøÂç±à³ÌµÄ»ù´¡£¬µ«ÊÇÓÉÓÚI/O¼¼Êõ±¾ÉíµÄÉè¼ÆÔÒò£¬Ò²Ê¹µÃI/O´¦Àí¼¼ÊõµÄÄѶȱȽϴó£¬ÐèÒª»¨·Ñ±È½Ï´óµÄ¾«Á¦½øÐÐѧϰ¡£
11.1 I/O¼ò½é
ÔÚ³ÌÐòÖУ¬ÊäÈëºÍÊä³ö¶¼ÊÇÏà¶ÔÓÚµ±Ç°³ÌÐò¶øÑԵģ¬ÀýÈç´ÓÓ²ÅÌÉ϶Áȡһ¸öÅä ......
StringBuffer s = “abc”; //¸³ÖµÀàÐͲ»Æ¥Åä
StringBuffer s = (StringBuffer)”abc”; //²»´æÔڼ̳йØÏµ£¬ÎÞ·¨½øÐÐǿת
StringBuffer¶ ......
Ò»¡¢static
ÇëÏÈ¿´ÏÂÃæÕâ¶Î³ÌÐò£º
public class Hello{
public static void main(String[] args){//(1)
System.out.println("Hello,world!");//(2)
}
}
¿´¹ýÕâ¶Î³ÌÐò£¬¶ÔÓÚ´ó¶àÊýѧ¹ýJava µÄ´ÓÀ´Ëµ£¬¶¼²»Ä°Éú¡£¼´Ê¹Ã»ÓÐѧ¹ýJava£¬¶øÑ§¹ýÆäËüµÄ¸ß¼¶ÓïÑÔ£¬ÀýÈçC£¬ÄÇÄúÒ²Ó¦¸ÃÄÜ¿´¶®Õâ¶Î´úÂëµÄÒâ˼¡£ËüÖ»ÊǼòµ ......