Exception handled by using throws keyword
Wed May 17 2023 15:05:53 GMT+0000 (Coordinated Universal Time)
Saved by
@Shankar
#instanceblocks
#inheritance
#overloading
import java.io.*;
class Demo
{
public static void main(String[] args) throws IOException
{
File f = new File("D:\\Cyber.txt");
if(f.createNewFile())
{
System.out.println("File Successfully Created");
}
else
{
System.out.println("File is Already Exist");
}
}
}
content_copyCOPY
Exception handled by using throws keyword And create a File by importing All Method(import java.io.*;),
Comments