public static void main(String[] args) {
		try {
			 fw=new FileWriter("MyTextFile.txt");
			 pw =new PrintWriter(fw);
			pw.println("ok this is fine");
			System.out.println("great");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		finally{
			if(fw != null){
				try {
					fw.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			if(pw != null){
				pw.close();
			}
		}
		
		

	}