刚刚学JAVA的菜鸟问过问题
import *;public class cacluate {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a,b,c;
System.out.print("请输入a:");
try{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
String inputLine=in.readLine();
a=Integer.valueOf(inputLine).intValue();
}catch(Exception exc){System.out.println("用户输入错误!");
return;
}
System.out.print("请输入b:");
try{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
String inputLine=in.readLine();
b=Integer.valueOf(inputLine).intValue();
}catch(Exception exc){System.out.println("用户输入错误!");
return;
}
if(a>b)
c=a;
System.out.println(c);
}
}
为什么最后一个输出语句会有错误,,,不懂,,,,另外求一名高人指点一下我JAVA,,,,QQ329956247可以帮我的家一下我,感激不尽