JAVA ѧϰ
ΪÁ˰Ñѧµ½ÖªÊ¶×ܽáÆðÀ´£¬ÌØ¿ª´ËÎÄ¡£Ö÷ÒªÊǰÑÿÌìѧµ½µÄ¶«Î÷¼ÓÒԼǼ£¬²»ÖÁÓÚ±ä³É´ó¹·ÐÜ¡£
20100310
½ñÌìÔÚÂÛ̳¿´ÈË·¢ÁËÁ½µÀjavaÌ⣬²»´í£¬°ÑÎÊÌâºÍ´ð°¸¶¼¼Ó½øÀ´£¬ÒÔ±ãÒÔºó²Î¿¼¡£
ÎÊÌâ:
ÒªÇóʵÏÖ·½·¨ÀïÃæµÄ´úÂ룺
1. function1()
·µ»ØÏàͬ闊¶È數×ÖÐÍ×Ö´®. Àý:
function1(“000000”) => “000001”
function1(”0023") => “0024”
function1(“0009”) => “0010”
function1(“000099”) => “000100”
function1(“9”) => “0” //號碼Ñ環ÔÙÓÃ
³Ìʽ½Ó¿Ú:
public static String function1(String num){....}
2. function2()
將數×ÖËÄ捨ÎåÈëÖÁijС數λ, 並·µ»ØÖ¸¶¨Î»數×Ö´®
function2(123.455,2) => 123.46
function2(123.449,2) => 123.45
function2(123.44,3) => 123.440
function2(123.4455,3) => 123.446
function2(123.4499,3) => 123.450
function2(123.9,0) => 124
³Ìʽ½Ó¿Ú:
public static double function2(double value,int decimalPlaces){....}
-------------------------------------------------------------------------------------
´ð°¸£º
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.RoundingMode;
import java.text.NumberFormat;
public class test {
public String function1(String str){
String rstr="";
int snum = Integer.parseInt(str);
int len =str.length();
snum++;
rstr =String.format("%0"+len+"d",(int)(snum % Math.pow(10,len)));
return rstr;
}
public double function2(double value, int decimalPlaces) {
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setRoundingMode(RoundingMode.HALF_UP); // ËÄÉáÎåÈë
nf.setMax
Ïà¹ØÎĵµ£º
JAVAÕýÔò±í´ïʽ--PatternºÍMatcher
×÷Õߣº³Â¹ã¼Ñ ÎÄÕÂÀ´Ô´£ºwww.fooldock.com
·¢²¼ÈÕÆÚ£º2004Äê11ÔÂ19ÈÕ ä¯ÀÀ´ÎÊý£º2585´Î
ÏÖÔÚJDK1.4ÀïÖÕÓÚÓÐÁË×Ô¼ºµÄÕýÔò±í´ïʽAPI°ü£¬JAVA³ÌÐòÔ±¿ÉÒÔÃâÈ¥ÕÒµÚÈý·½ÌṩµÄÕýÔò±í´ïʽ¿âµÄÖÜÕÛÁË£¬ÎÒÃÇÏÖÔÚ¾ÍÂíÉÏÀ´Á˽âÒ»ÏÂÕâ¸öSUNÌṩµÄ³Ù ......
Óû§·ÃÎÊ¿ØÖÆ(Access control )»úÖÆ×ÜÊÇÎ§ÈÆ´ÖÁ£¶ÈºÍϸÁ£¶ÈÁ½¸ö·½ÃæÀ´ÌÖÂÛ£º
¡¡¡¡´ÖÁ£¶È¿ØÖÆ£º¿ÉÒԹ涨·ÃÎÊÕû¸ö¶ÔÏó»ò¶ÔÏóȺµÄij¸ö²ã£¬¶øÏ¸Á£¶È¿ØÖÆÔò×ÜÊÇÔÚ·½·¨»òÊôÐÔ²ã½øÐпØÖÆ£¬±ÈÈ磺
¡¡¡¡´ðÓ¦Ò»¸öÎļþΪֻ¶ÁÊÇÊôÓÚ´ÖÁ£¶È¿ØÖÆ£¬¶ø´ðÓ¦¶ÔÕâ¸öÎļþijÐÐÓÐд²Ù×÷ÔòÊôÓÚϸÁ£¶È¿ØÖÆ¡£
¡¡¡¡Ò»¸öºÃµÄÓû§¿ØÖÆ»úÖÆµ±È»¼È´ðÓ¦ ......
private void postMethod(String url) throws IOException
{
url = "http://www.newsmth.net/bbslogin2.php";
PostMethod postMethod = new PostMethod(url);
// ÌîÈë¸÷¸ö±íµ¥ÓòµÄÖµ
NameValuePair[] data = { new NameValuePair("id ......
1¡¢Ê²Ã´ÊÇ´æ´¢¹ý³Ì¡£´æ´¢¹ý³ÌÊÇÊý¾Ý¿â·þÎñÆ÷¶ËµÄÒ»¶Î³ÌÐò£¬ËüÓÐÁ½ÖÖÀàÐÍ¡£Ò»ÖÖÀàËÆÓÚSELECT²éѯ£¬ÓÃÓÚ¼ìË÷Êý¾Ý£¬¼ìË÷µ½µÄÊý¾ÝÄܹ»ÒÔÊý¾Ý¼¯µÄÐÎʽ·µ
»Ø¸ø¿Í»§¡£ÁíÒ»ÖÖÀàËÆÓÚINSERT»òDELETE²éѯ£¬Ëü²»·µ»ØÊý¾Ý£¬Ö»ÊÇÖ´ÐÐÒ»¸ö¶¯×÷¡£ÓеķþÎñÆ÷ÔÊÐíͬһ¸ö´æ´¢¹ý³Ì¼È¿ÉÒÔ·µ»ØÊý¾ÝÓÖ¿ÉÒÔÖ´Ðж¯×÷¡£
2¡¢Ê²Ã´Ê±ºòÐèÒªÓô洢¹ý³Ì
......
×¢Ò⣺ÔÚJava MEƽ̨ÉÏ»ñÈ¡ÊÖ»ú´®ºÅ£¬ÔÚijЩÊÖ»úÖÐÊÇ¿ÉÐе쬵«ÊÇijЩÊÖ»úÖоÍÊÇÎÞ·¨»ñÈ¡µÄ¡£¶ÔÓÚ¼´±ãÊÇ¿ÉÒÔ»ñÈ¡´®ºÅµÄÊÖ»úÀ´Ëµ£¬Ò²½ö½öÏÞÓÚ½øÐÐÁËÇ©ÃûµÄÓ¦ÓóÌÐò²Å¿ÉÒÔ»ñµÃÊÖ»ú´®ºÅ¡£
ÔÚŵ»ùÑÇÊÖ»úÖУ¬ÎÒÃÇ¿ÉÒÔÕâÑù»ñÈ¡ÊÖ»ú´®ºÅ£º System.getProperty("com.nokia.mid.imei")
ÔÚSeries60ƽ̨µÄÊÖ¼¸ÖÖ£¬ ......