/public class ExceptionDemo {
/ static int caculate(int a,int b){
/ int c=a/b;
/ return c;
/ }
/ public static void main(String args[]){
/ try{
/ //静态方法最好用类名调用.
/ int c=ExceptionDemo.caculate(9,0);
/ System.out.println(c);
/ }
/ catch(Exception e){
/ System.err.println("异常:"+e.toString());
/ e.printStackTrace();
/ }
/ }
/}
/ static int caculate(int a,int b){
/ int c=a/b;
/ return c;
/ }
/ public static void main(String args[]){
/ try{
/ //静态方法最好用类名调用.
/ int c=ExceptionDemo.caculate(9,0);
/ System.out.println(c);
/ }
/ catch(Exception e){
/ System.err.println("异常:"+e.toString());
/ e.printStackTrace();
/ }
/ }
/}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货