JAVA ³£Óü¼ÇÉ
1.²ð·Ö×Ö·û´®
Óöµ½ÌØÊâ×Ö·û£¬±ÈÈ磺¶Ô‘$’·ûºÅ£¬¾ÍÓ¦¸ÃʹÓÑ\\$’£¬ºó×ܽá¿ÉÒÔ¼Ó¸ö·½À¨ºÅÈç "[.]"¡£
2.±éÀúHASHMAP
Iterator itr = map.keySet().itrator();
while(itr.hasNext())
{
Object temp1 = itr.next();
Object temp2 = tab.get(temp1);
}
3.ÈÕÀú²Ù×÷
Calendar c = Canlendar.getInstance();
c.get(c.YEAR);//»ñÈ¡Äê·Ý£¬ÆäËûͬÀí
c.add(c.MONTH,-1);//ÉϸöÔµÄÈÕÆÚ
4.Ëæ»úÊý
Random random = new Random();
int ran = random.nextInt(100);
×¢Ò⣺·¶Î§[0£¬100£©
5.¶ÁÈ¡ÅäÖÃÎļþ
¶ÔÓÚini Îļþ»òÕß propertiesÎļþ£¬ÆäʵֻҪÄÚÈÝÊÇ ds=dfjh»òÕß kd: ksadkfÕâÖÖ£¬¾Í¿ÉÒÔÓÃ
Properties pro = new Properties();
//pro.load (Main.class.getResourceAsStream("/test.properties"));»òÕß
//pro.load (new FileInputStream ("test.properties"));
pro.getProperty ("test")
6.±éÀúvector
Á½ÖÖ·½Ê½£º
// for (Enumeration e = v.elements ();e.hasMoreElements ();)
// {
// System.out.println (e.nextElement ().toString ());
// }
Iterator item = v.iterator ();
while(item.hasNext ())
{
System.out.println (item.next ().toString ());
}
7.JAVAÔÚWINDOWSϵ÷ÓÃÆäËû³ÌÐò
try
{
Process p = Runtime.getRuntime().exec("mspaint");
p.waitFor();
}catch ...
8.»ñÈ¡¼üÅÌÊäÈë
BufferedReader input = new BufferedReader(new InputStream(System.in));
String s = input.readLine();
9.×ÓÀàÎ޲ι¹Ôì»áÒþʽsuper()£¬Èô¸¸ÀàûÓÐÉùÃ÷Î޲ι¹Ô캯Êý£¬¶øÇÒÓк¬²ÎÊý¹¹Ô캯Êý£¬³ÌÐò±àÒ벻ͨ¹ý¡£
10.ÃüÁîÌáʾ·ûÏ£¬±àÒëjavaÎļþ ½¨ÒéʹÓÃ"javac -d . xxx.java" ÄÜ×Ô¶¯Éú³É³ÌÐòÖеİü¡£¶øÔËÐÐÖ»ÐèÒª"java packname.mainclass".
11.ʹ
Ïà¹ØÎĵµ£º
ȺÄÚһλÅàѵÀÏʦ·¢³öÀ´Ò»¸öÎÊÌâ:
int[][] a = new int[10][10];
ÕâÖÖ¶àάÊý×é»áÔÚÕ»ÉÏÉú³É¼¸¸ö¶ÔÏó?
Õâ¸öÎÊÌâÐÂÏÊ,ûÈËÎʹý.
·¢³öÀ´ºó ´ó¼Ò¶¼ÈÏΪÓм¸¸öÔªËØ ¾Í»áÉú³É¼¸¸ö¶ÔÏó.
ÎÒ¿ªÊ¼Ò²
ÕâôÈÏΪ.
ÓÚÊÇд¸öÁ˳ÌÐòÊÔÁËÏÂ.·¢ÏÖûÓÐÄÇô¼òµ¥
public static void main(String[] args) {
int[][] a = new int[10][10 ......
1.¼Ì³Ð£ºÊÇÖ¸ÏÈ´´½¨Ò»¸ö¹²ÓÐÊôÐÔµÄÒ»°ãÀ࣬¸ù¾Ý¸ÃÒ»°ãÀàÔÙ´´½¨¾ßÓÐÌØÊâÊôÐÔµÄÐÂÀ࣬ÐÂÀà¼Ì³ÐÒ»°ãÀàµÄ״̬ºÍÐÐΪ£¬²¢¸ù¾ÝÐèÒªÔö¼Ó×Ô
¼ºµÄеÄ״̬ºÍÐÐΪ
Óɼ̳жøµÃµ½µÄÀà³ ......
package debug;import java.io.*;import java.lang.Thread;class MyThread extends Thread{ public int x = 0; public void run(){ System.out.println(++x); }}class R implements Runnable{ private int x = 0; public void run(){ System.out.printl ......
2009Äê10ÔÂ25ÈÕ£¬µÃÒ»Êéµê200ÔªÂòÁËËı¾Êéj2se»ù´¡½Ì³Ì£¬j2eeÓ¦Óÿª·¢Ïê½â£¬javaÏîÄ¿¿ª·¢È«³Ìʵ¼£¬java web¿ª·¢ËÙѧ±¦µäÊ鿪ʼ
2010Äê2ÔÂ3ÈÕ£¬µÚÒ»Ì×»ùÓÚú¿ó°²È«¹ÜÀíµÄÈí¼þÄ£Ðͼ°Æ䲿·Ö´úÂë³ÉÐÍ
Èý¸öÔ£¬ÕâÊÇÒ»³¡Ø¬ÃΣ¬²»¹ýÕâÈý¸öÔ£¬ÓÖÊÇÒ»ÖÖ¾ªÏ²ºÍ¿ìÀÖ
´ÓÊý¾ÝÀàÐÍ£¬Óï·¨½á¹¹£¬jdk ¹ýÑ»·£¬´³Êý×飬¼¯ºÏ£¬µü´ú£¬¶ÓÁУ ......