分类：电脑/网络-程序设计-JAVA相关
问题：麻烦看看这个Java程序错在哪里importjava.io.*; 
import .io.*;public class Ab{  public static void main(String args[]) throws IOException  {    InputStreamReader reader=new InputStreamReader(System.in);    BufferedReader input=new BufferedReader(reader);    System.out.println("请输入a值");    String s=input.reaimport .io.*;public class Ab{  public static void main(String args[]) throws IOException  {    InputStreamReader reader=new InputStreamReader(System.in);    BufferedReader input=new BufferedReader(reader);    System.out.println("请输入a值");    String s=input.readLine();    double a=Double.parseDouble(s);    System.out.println("请输入b值");    s=input.readLine();    double b=Double.parseDouble(s);    System.out.println("交换前a="+a+",b="+b);    a=t;t=b;b=a;    System.out.println("交换后a="+a+",b="+b);    }  }
回答：首先：t 变量没有声明：doue t = 0;然后：算法错了：应为：t = a;a = b;b = t;给你改过的源码自己看看.import java.io.*;public class Ab{  public static void main(String args[]) throws IOException  {  InputStreamReader reader = new InputStreamReader(System.in);  BufferedReader input     = new BufferedReader(reader);  System.out.println("请输入a值");  String s=input.readLine();  double a=Double.parseDouble(s);  System.out.println("请输入b值");  s=input.readLine();  double b=Double.parseDouble(s);  double t = 0;  System.out.println("交换前a="+a+",b="+b);  t = a;  a = b;  b = t;  System.out.println("交换后a="+a+",b="+b);  }}