Login    New User    Forgot Password    Help      

Input

Java Tutorials

Example

// input output
import java.io.*;
class s3
{
public static void main(String args[])throws IOException
{
char c;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter any Line ");

String str=new String();
// read characters
do
{
c=(char) br.read();
str=str+c;
}
while(c!='\n');
System.out.println(str);
}
}

Output

Java Tutorials