import java.util.*;
import java.io.*;class fruit{
public String name;
public float price;
public int quantity;
fruit(String name, float price,int quantity){
this.name=name;
this.price=price;
this.quantity=quantity;
}
}
public class goumai{
public String readLine() throws IOException {
try {
String str =new BufferedReader(new InputStreamReader(System.in)).readLine();
}
catch(IOException nfe){
System.out.println(nfe.getMessage());
}
return(str); //错误地方
}
public static void main(String[] args){
fruit[] fr=new fruit[3];
fr[0]=new fruit("apple",2,100);
fr[1]=new fruit("pear",2,200);
fr[2]=new fruit("banana",3,100);

Hashtable hash=new Hashtable();
hash.put("A",fr[0]);
hash.put("B",fr[1]);
hash.put("C",fr[2]);

String str =new BufferedReader(new InputStreamReader(System.in)).readLine(); 
//StringReader red =new StringReader(String );
//String temp=red.read();
//Scanner read=new Scanner(System.in);
//String br=read.nextLine();
//String br=read.nextLine();
//Object obj=hash.get(br);
//System.out.println(obj.name);//
System.out.println(((fruit)hash.get(str)).name);
//System.out.println(br);

}
}
错误信息如下:
D:\java>javac goumai.java
goumai.java:24: cannot resolve symbol
symbol  : variable str
location: class goumai
                return(str);
                       ^
我都要崩溃了,调完一个错误 ,又出现一大堆错误,我头都要炸了,帮看看