---
title: "面试题  异常的抛出和捕获"
author: "J2EE大鸟"
date: "2013-03-07T14:41:24Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2013-03-07T14:41:24Z"
id: 1825542
url: "https://benworld.iteye.com/blog/1825542"
---

```
public class ExceptionTest {
	
	public static void main(String[] args) {
		int i = 0;
		try {
			if(i == 0) {
				throw new IOException();
			}
		} catch (IOException e) {
			System.out.println("right!");
		}
	}
}
```

 

运行正常， 输出正确结果： right！。