IO 조작 IO 이상 처리

/* 
*            
*                
* Copyright (c) 2011,               
* All rights reserved.   
*     :IO   IO                               
*       :                                  
*     :2011    10    03      
*     :x1.0            
   
*                 
*     :  
*     : 
*     :   
*           
*/

import java.io.*;
class FileWriterTest2 
{
	public static void main(String[] args) 
	{
		FileWriter fw = null;
		try
		{
			fw = new FileWriter("Test.txt");
			fw.write("abcdefg");
			
		}
		catch (IOException e)
		{
			System.out.println("catch:" + e.toString());
		}
		finally
		{
			try
			{
				if(fw != null)
					fw.close();
			}
			catch (IOException e)
			{
				System.out.println("catch:" + e.toString());
			}
		}
	}
}

좋은 웹페이지 즐겨찾기