1 package com.gh;
import java.util.Scanner;
/**
* 自定义异常
* @author ganhang
*
*/
public class ExceptionDemo {
public static void main(String[] args) throws exception {
Scanner sc = new Scanner(System.in);
System.out.println("请输入帐号aaa密码123");
String id = sc.nextLine();
int pwd = sc.nextInt();
if (!id.equals("aaa") || pwd != 123)
throw new exception("帐号或密码错误!");
else System.out.println("帐号正确!");
}
}
class exception extends Exception{
public exception(String mes){
super(mes);
}
}

太久写的,知识点都没记,慢慢上传吧

最新文章

  1. curl上传图片文件
  2. 给ubuntu的docky添加可以直接打开的图标
  3. 进入git diff 界面,无法继续输入命令
  4. BZOJ 2282 & 树的直径
  5. MIFARE系列6《射频卡与读写器的通讯》
  6. html 页面表单如果是disabled,则不能提交到服务器端,request.getParameter得到的将为null
  7. TestNG中同一个类中执行多个test()方法如何配置testng.xml
  8. Bash 小知识点
  9. CodeForces 299A Ksusha and Array
  10. js中的"=="与"==="的区别
  11. jQuery EasyUI中常常遇到的问题(FAQ)
  12. 可伸缩性/可扩展性(Scalable/scalability)
  13. hdu4497 正整数唯一分解定理应用
  14. Redis .NET开源组件Beetle.Redis
  15. Sping--life cycle
  16. IOS中的JSON数据的解析
  17. 《Shazam It! Music Recognition Algorithms, Fingerprinting, and Processing》译文
  18. IO 流小记录
  19. 使用C#读取网站相对路径文件夹下所有图片
  20. vue1.0到2.0

热门文章

  1. android解决内存溢出的问题(没有从根本上解决)
  2. using的用法
  3. python把汉字转换成拼音实现程序
  4. 第八章 C#面向对象编程(Object-Oriented Programming,OOP)简介
  5. eclipse手动添加源码
  6. 解决spark运行中failed to locate the winutils binary in the hadoop binary path的问题
  7. sping+maven+mybatis+ehcache续之实现mapper
  8. NET Core个人博客
  9. 我的第一个REST客户端程序!
  10. viewpager的layout_width="wrap_content"无效问题