Skip to main content

Posts

Showing posts with the label File I/O

JAVA : W1-M7

File I/O Learning Objective Welcome to the Day4 in Java . Here we would concentrate on solving File I/O Problems. Introduction The Java I/O means Java Input/Output. It is provided by the java.io package. This package has an InputStream and OutputStream. Java InputStream is defined for reading the stream, byte stream and array of byte stream. Java offers extensive - yet easy to use - file handling classes that make it a breeze to read and write files. In this tutorial, we'll start by covering the basics of file input and output, as well as covering some associated topics, such as trapping exceptions and I/O errors. File output Our first example will be a program that writes a string to a file. In order to use the Java file classes, we must import the Java input/output package (java.io) in the following manner import java.io.*; Inside the main method of our program, we m...