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

ÍøÉÏÕÒÁ˸öjavaËæ»úÉú³ÉÃÜÂëµÄ¡£¡£¡£·¢ÉÏÀ´¼Ç¼һÏ¡£

import java.util.Random;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(genRandomNum(10));
}
/**
* Éú³ÉËæ¼´ÃÜÂë
* @param pwd_len Éú³ÉµÄÃÜÂëµÄ×ܳ¤¶È
* @return ÃÜÂëµÄ×Ö·û´®
*/
public static String genRandomNum(int pwd_len){
//35ÊÇÒòΪÊý×éÊÇ´Ó0¿ªÊ¼µÄ£¬26¸ö×Öĸ+10¸öÊý×Ö
final int maxNum = 36;
int i; //Éú³ÉµÄËæ»úÊý
int count = 0; //Éú³ÉµÄÃÜÂëµÄ³¤¶È
char[] str = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };

StringBuffer pwd = new StringBuffer("");
Random r = new Random();
while(count < pwd_len){
//Éú³ÉËæ»úÊý£¬È¡¾ø¶ÔÖµ£¬·ÀÖ¹Éú³É¸ºÊý£¬

i = Math.abs(r.nextInt(maxNum)); //Éú³ÉµÄÊý×î´óΪ36-1

if (i >= 0 && i < str.length) {
pwd.append(str[i]);
count ++;
}
}

return pwd.toString();
}
}


Ïà¹ØÎĵµ£º

java¿ª·¢»·¾³´î½¨ д¸øjavaÐÂÊÖ

Ò»¡¢windowsÏ¿ª·¢»·¾³µÄ´î½¨
1¡¢´Óhttp://java.sun.com/ÉÏÏÂÔØwindowsƽ̨µÄJDK,²¢°²×°¡£¼ÙÉ谲װĿ¼Ϊ£ºC:\jdk6.0
2¡¢É趨Ïà¹Ø»·¾³Á¿£¨ÒÔwindowsXP)Àý£º
       1¡¢ÓÒ»÷×ÀÃæÉÏ“ÎҵĵçÄÔ”£¬Ñ¡ÔñÊôÐÔ
       2¡¢ÔÙÑ¡Ôñ“¸ß¼¶”»îÒ ......

JAVA³õÂóÌ(Touch)0.1

     JavaµÄ×¢ÏúÓï¾äǰҪʹÓÃ×¢ÊÍ·û“//”¡£
     ÀàÉùÃ÷¹Ø¼ü×Öclass´´½¨ÁËÒ»¸ö×Ô¶¨ÒåÀࣻÀàµÄÃû×ÖΪWelcome2£¬ÎªJavaÉùÃ÷ÀàÓï¾ä£ºclass Welcome2 {}¡£
     ·½·¨¹Ø¼ü×ÖmainÉùÃ÷ÁËmain()·½·¨£¬Àý£ºPublic static void main(String args[]) { ......

µ÷ÓÃGoogle API µÄJavaʵÏÖ£¨Web service£©


Web ServiceµÄ·Ï»°¾Í²»ËµÁË¡£¾Í˵ÔõôʹÓðɡ£
1.ÐèÒªjava»·¾³ µ½http:.//java.sun.com/J2SE  ¿ÉÒÔÏÂÔØ Java Development Kit
2.ÐèÒªGoogle APIµÄJarÎļþ£¬Googleapi.jar¡£¿ÉÒÔµ½http://www.google.com/apisÏÂÔØ¡£Ìî¼Ó½øCLASSPATH.
3.ÉêÇëGoogle·ÃÎÊÕʺţ¬Ä¿Ç°GoogleÖ§³ÖÃâ·ÑÉêÇëµÄ·½Ê½£¬Óû§ÐèҪʹÓÃÒ»¸öem ......

java¼ÆËãÁ½¸öÊýÊÇ·ñÎó²îÔÚ°Ù·ÖÖ®¼¸

ÒÔÏÂÊǼÆËãÁ½¸öÊýÎó²îÊÇ·ñÔÚ10% £¬Èç¹ûÔÚ10%ÒÔÄÚÊÇÕý³££¬ÆäËûÊDz»Õý³££¬ÓýÏСµÄÊý*10%+ÓýÏСµÄÊý=ÓýÏСµÄÊý*1.1%
double costNum =2;//µç·Ñƽ¾ùÈÕµçÁ¿
double amountNum =3; //µçÁ¿Æ½¾ùÈÕµçÁ¿

if(amountNum ......

java:Applet²¼¾ÖÎÊÌâ,ÈçºÎÌí¼Ó°´Å¥£¬±êÇ©ÎÊÌâ×ܽá


½ñÌìѧϰÁËapplet²¼¾ÖÎÊÌ⣺
°´Å¥¡¢±êÇ©ÊÇÔõÑù¼ÓÈëµ½applet³ÌÐò(ÈÝÆ÷)µ±ÖÐÈ¥µÄÄØ£¿
ÐèÒªÓõ½²¼¾ÖÈÝÆ÷¹ÜÀíÆ÷(LayoutManager)£ºËüÓÃÓÚЭÖúÈÝÆ÷È·¶¨¼ÓÈëµÄ×é¼þ(°´Å¥µÈ)Ó¦¸Ã·ÅÖõÄλÖÃ
awtÌṩÁË4Öг£ÓõIJ¼¾ÖÈÝÆ÷¹ÜÀíÆ÷
>>FlowLayout
>>BorderLayout
>>GridLayout
>>CardLayout
appletĬÈÏÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ