In this article we look at introduction to input and output in Java programming language.
Almost all programs in Java require some input which is processed by the program and generates some output. Java provides an API in the form of packages namely java.io, and java.nio for dealing with I/O. Both these packages contain various classes which can be used to read and write data to various sources like a console, file, peripheral device, or a socket.
Java handles transfer of data in the form of streams. A stream is a flow of data which is composed of bytes. So, the data is transferred continuously as a flow. Java creates three streams automatically which are attached to the console. They are:
- out: Standard output stream
- in: Standard input stream
- err: Standard error stream
Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.
He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.
He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.
Leave a Reply