//求最大值
public class MaxDemo{
public static void main(String[] args){
int[] arr = {1,1,4,5,45,6,48,6};
java.util.Arrays.sort(arr);
System.out.println("排序后为:"+java.util.Arrays.toString(arr));
System.out.println("最大值:" + arr[arr.length-1]);
}
}
//拷贝文件
import java.io.*;
public class CopyDemo{
public static void main(String[] args)throws IOException{
BufferedReader fr = new BufferedReader(new FileReader("my.txt"));
BufferedWriter fw = new BufferedWriter(new FileWriter("D:\\text.txt"));
String str = null;
while((str=fr.readLine())!=null){
fw.write(str);
fw.newLine();
}
fw.close();
fr.close();
}
}
PS:有时间再来给你写,现在上班!