Monday 14 April 2014

JAVA Programs To Implement The Java I/O Program.


Write a JAVA Programs To Implement The Java I/O Program

Ex: No: 14 JAVA I/O

Aim:To write a JAVA programs to implement the Java I/O program.

Algorithm:

Step 1: Start the program.
Step 2: Declare the main function.
Step 3: create the memory space for in data.
Step 4: Get the data and read the data.
Step 5: Then display the get data.
Step 7: Stop the program

Programs:

import java.io.*;
class Echo
{
public static void main (String[] args) throws IOException
{
InputStreamReader inStream =new InputStreamReader( System.in ) ;
BufferedReader stdin =new BufferedReader( inStream );
String inData;
System.out.println("Enter the data:");
inData = stdin.readLine();
System.out.println("You entered:" + inData );
}
}

Output:

Enter the data: Hi. . Welcome to E.S
You entered: Hi. . Welcome to E.S

Result:

Thus the implementation of JAVA program for Java I/O program is executed and the output has been verified.

0 comments:

Post a Comment