Java tutorials for Beginners – Java I/O Streams

(Java programming Example for Beginners)

Java I/O Streams

In this tutorial, we will learn about Java input/output streams and their types.

In Java, streams are the sequence of data that are read from the source and written to the destination.

An input stream is used to read data from the source. And, an output stream is used to write data to the destination.


class HelloWorld{
    public static void main(String[] args){
        System.out.println("Hello, World!"); 
    }
}

For example, in our first Hello World example, we have used System.out to print a string. Here, the System.out is a type of output stream.

Similarly, there are input streams to take input.

Input stream reads data from source to program and output stream writes file from program to destination

We will learn about input streams and output streams in detail in the later tutorials.


Types of Streams

Depending upon the data a stream holds, it can be classified into:

  • Byte Stream
  • Character Stream

 


Byte Stream

Byte stream is used to read and write a single byte (8 bits) of data.

All byte stream classes are derived from base abstract classes called InputStream and OutputStream.


Character Stream

Character stream is used to read and write a single character of data.

All the character stream classes are derived from base abstract classes Reader and Writer.

 

 

Java tutorials for Beginners – Java I/O Streams

Sign up to get end-to-end “Learn By Coding” example.


Two Machine Learning Fields

There are two sides to machine learning:

  • Practical Machine Learning:This is about querying databases, cleaning data, writing scripts to transform data and gluing algorithm and libraries together and writing custom code to squeeze reliable answers from data to satisfy difficult and ill defined questions. It’s the mess of reality.
  • Theoretical Machine Learning: This is about math and abstraction and idealized scenarios and limits and beauty and informing what is possible. It is a whole lot neater and cleaner and removed from the mess of reality.
Disclaimer: The information and code presented within this recipe/tutorial is only for educational and coaching purposes for beginners and developers. Anyone can practice and apply the recipe/tutorial presented here, but the reader is taking full responsibility for his/her actions. The author (content curator) of this recipe (code / program) has made every effort to ensure the accuracy of the information was correct at time of publication. The author (content curator) does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause. The information presented here could also be found in public knowledge domains.