Monday, June 15, 2009

Format of Input

import java.io.Console;
import java.lang.String;
import java.io.IOException;



public class input1 {

public static void main (String args[]) throws IOException {

Console c = System.console();
if (c == null) {
System.err.println("No console.");
System.exit(1);
}
String login = c.readLine("Enter your login: ");
String n=console.readline("enter age");

System.out.print("name is",login);
c.format("name is %s",login);
c.format("name is %s",n);
}
}

No comments:

Post a Comment