FileIO

PHOTO EMBED

Wed May 17 2023 15:03:24 GMT+0000 (Coordinated Universal Time)

Saved by @Shankar #instanceblocks #inheritance #overloading

import java.io.*;

class UsingThrowsKeyword 
{
	public static void main(String[] args) 
	{
		File c = new File("d:\\Success.txt");
		try{
		if(c.createNewFile())
			{
				System.out.println("file Create");
			}
			else
				{
					System.out.println("file is already Exist");
				}
		}
		catch(IOException i)
			{
				System.out.println("Exception Modidied");
			}
	}
}
content_copyCOPY

IOException handled by using try catch block, And create a File by importing all Methods.