I went through a java tutorial that allowed me to create a text file and write the words,\"20 Bruce Wayne\" in it. The last method that is called in the main class is named
is used for closing the file which is opened in write mode because to reduce/to make secure our data we use close() method and it throws exception like (java.io.IOEXCEPTION) why means any method call with respect to object only because it is public void close() that means it is instance so it is calls with respect with object so in some times is there a chance to getting object to get null any method calls with respect to null reference then it getting NullPointerException so this is the code code in finally block means what ever files we open that and all relinquished in finally block