java ÀàµÄÒýÓÃ
JAVA ÀàÒýÓÃÓг£Óõ½µÄÓÐÈýÖУº
µÚÒ»ÖÖ :super ÊǸ¸ÀàÒýÓã¬Í¨¹ýËü¿ÉÒÔ·ÃÎʸ¸ÀàµÄÊôÐԺͷ½·¨¡£
µÚ¶þÖÖ £ºthisÊǵ±Ç°ÀàµÄÒýÓá£Í¨¹ýËû¿ÉÒÔ·ÃÎʵ±Ç°ÀàµÄ·½·¨ºÍÊôÐÔ¡£
µÚÈýÖÖ£º×ÓÀàµÄÒýÓã¬ÎÒ³£Óø¸ÀàµÄ¶ÔÏóÈ¥·ÃÎÊ×ÓÀàµÄ¶ÔÏóÀ´ÊµÏÖ¶à̬¡£ÀýÈ磺ˮ¹ûÀà Ë®¹û=new Æ»¹ûÀࣨ£©£»
ÕâÑùÎÒÃÇ¿ÉÒÔͨ¹ý Ë®¹ûÕâ¸ö¶ÔÏóÈ¥·ÃÆ»¹ûÀàµÄÊôÐԺͷ½·¨¡£
Ïà¹ØÎĵµ£º
±¾Ê¾Àý´ÓÍøÉÏÏÂÔØÒ»±¾Ð¡Ëµ£¬²¢±£´æÎª UTF-8 ¸ñʽ¡£
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.MalformedURLException;
......
1 String ºÍStringBufferµÄÇø±ð
JAVAƽ̨ÌṩÁËÁ½¸öÀࣺStringºÍStringBuffer£¬ËüÃÇ¿ÉÒÔ´¢´æºÍ²Ù×÷×Ö·û´®£¬¼´°üº¬¶à¸ö×Ö·ûµÄ×Ö·ûÊý¾Ý¡£StringÀàÌṩµÄÊýÖµ²»¿É¸Ä±äµÄ×Ö·û´®¡£StringBufferÀàÌṩµÄ×Ö·û´®½øÐÐÐ޸ġ£µ±ÖªµÀ×Ö·ûÊý¾ÝÒª¸Ä±äµÄʱºòÄã¾Í¿ÉÒÔʹÓÃStringBuffer£¬¿ÉÒÔʹÓÃStri ......
//1.±àдһ¸ö³ÌÐò£¬¸Ã³ÌÐò¿É¶ÁÈëÒ»¸öÍⲿÎļþ£¬²¢½«ÎļþÄÚÈݸ³Öµ¸øÒ»¸ö×Ö·û´®
package Zhangyiwei
import java.io.*;
public class Zhangyiwei {
public static String filename = "c:\\1.txt";
public static void main(String[] args) throws FileNotFoundException, IO ......
importjava.text.DecimalFormat;
¡¡¡¡
publicclassTestNumberFormat{
¡¡¡¡
¡¡¡¡publicstaticvoidmain(String[]args){
¡¡¡¡¡¡¡¡doublepi=3.1415927;¡¡//Ô²ÖÜÂÊ
¡¡¡¡¡¡¡¡//ȡһλÕûÊý
¡¡¡¡¡¡¡¡System.out.println(newDecimalFormat("0").format(pi));¡¡¡¡¡¡//3
¡¡¡¡¡¡¡¡//ȡһλÕûÊýºÍÁ½Î»Ð¡Êý
¡¡¡¡¡¡¡¡System ......
ÁªÍ¨£º³¹µ×·ÅÆúORÓûÇܹÊ×Ý£¿
ÒµÄÚÈÕǰ´«³öÏûÏ¢£¬ÓÉÓÚÆ»¹û¼á³Ö·Ö³Éģʽ£¬ÁªÍ¨¸ß²ã¶ÔÓÚÒýÈëÆ»¹û̬¶ÈÒÑÎÞÔçÏȼá¾ö¡£“Ëæ×ÅÊÖ»úµÄ²»¶Ï¸üл»´ú£¬Ò»µãÓпÉÄܰüº¬µÄ¹¦ÄÜÌØ±ðÊÇÁªÍ¨¼ÓÈë¹È¸è¿ª·ÅÊÖ»úÁªÃË£¬ÔÚÊý¾Ý±£»¤ºÍ¼á¹ÌÐ×÷¼Æ»®ÍÆ×ÔÓпª·Å²Ù×÷ƽ̨ÊÖ»ú£¬ÔÚÊý¾Ý±£»¤ºÍ¼á¹ÌÐ×÷ javaµç×ÓÊéÃâ·ÑÏÂÔØiPhoneÔÚÆäÕ½ÂÔÖ ......