应用实例
import java.io.*;public class DataStreamDemo{ public static void main(String[] args) { try { DataOutputStream out=new DataOutputStream(new FileOutputStream("F:\\workspace\\JavaPrj\\test.txt")); double[] prices={18.99,9.22,14.22,5.22,4.21}; int[] units={10,10,20,39,40}; String[] descs={"bike","book","boat","boot","bus"}; for(int i=0;i0) { str+=" "; n--; } return str; }}