zoukankan      html  css  js  c++  java
  • 异常处理

    try{

    }catch(){

    }finally{

    }

    例:

    private int chooseMenu() {
    Scanner scan = new Scanner(System.in);
    System.out.println("请选择操作:");
    System.out.println("1: 查询余额");
    System.out.println("2: 存款");
    System.out.println("3: 取款");
    System.out.println("4: 转账");
    System.out.println("5: 修改密码");
    System.out.println("6: 退出,重新登录");
    System.out.println("7: 退出系统");
    System.out.println("请输入您的操作:");
    int a = 0;

    try {
    a = scan.nextInt();
    } catch (InputMismatchException ime) {

    } catch (Exception ex) {
    ex.printStackTrace();
    }
    return a;
    }

  • 相关阅读:
    BZOJ 1003 物流运输
    549565
    26566
    68
    554554
    5656
    49886
    5989
    6898
    656
  • 原文地址:https://www.cnblogs.com/134-hw/p/6160124.html
Copyright © 2011-2022 走看看