Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

File processing is performed in Java using various classes. The primary class used to handle files is called File. The File class is part of the java.iopackage. 

Example of file processing

As we can see in the following example, there are a lot of classes we need to import to simply read a file, and in addition, we have to handle the exception thrown by some methods. In Python, it is two lines.

...