使用JAVA语言编写:1。编写程序,把由10个元素组成的一维数组逆序存放并输出。
2。编写程序,把两个文本文件合并为另一个文本文件。
2。编写程序,把两个文本文件合并为另一个文本文件。
解决方案 »
- 身份证号码隐藏生日的部分问题?
- 用一个字符串转换成一个流,有兴趣的进来讨论一下!
- 想和我一样的初学者一起分享知识 大家一起提高!
- (求助)计算微积分的计算器源码,谢谢!
- Runtime.getRuntime().exec(cmd)不能执行shell脚本啊
- 在JAVA中,怎样实现点击一个按钮就运行相应的批处理文件?
- 有关finalize
- Applet 授权的问题
- 安装JDK时出现"warning:default charset GBK not supported,using ISO-8859-1 instead"是怎么回事啊?
- 如何升级IBM visualage for java jdk版本
- 菜鸟问题 (非静态变量不能在静态环境中引用?),谢
- !!!使用EXE4J生成JAVA可执行文件,总是报错,明天就交论文了.!!!
String[] a = {"a","b","c","d","e"}
String[] b = new String[5];
for (int i=0;i<a.length;i++)
b[a.length-i] = a[i]; //逆序写如b数组for (int j=0;j<b.length;j++)
System.out.println(b[j]); //输出b数组2:第二题:import java.io.*;
public class TxtFileLence {
public static void main(String[] args) throws FileNotFoundException {
BufferedReader a = new BufferedReader(new FileReader("e:\\a.txt"));
BufferedReader b = new BufferedReader(new FileReader("e:\\b.txt")); PrintWriter out;
try {
out = new PrintWriter(new BufferedWriter(
new FileWriter("e:\\c.txt")));
String s = null;
while ((s = a.readLine()) != null) {
out.println(s);
}
while ((s = b.readLine()) != null) {
out.println(s);
}
out.close();
} catch (IOException e) {
e.printStackTrace();
} }
}