public class ReadSource
{
public static void main(String[] arguments)
{
try
{
FileReader file = new FileReader("ReadSource.java");
BufferedReader buff = new BufferedReader(file);
String line;
line = buff.readLine();
while (line != null)
{
System.out.println(line);
line = buff.readLine();
}
buff.close();
}
catch (IOException e)
{
System.out.println("Error " + e.toString());
}
}
}
Get Input
While (input ok)
{
Process
Get Input
}
StringTokenizer st = new StringTokenizer("this is a test");
while (st.hasMoreTokens())
{
System.out.println(st.nextToken());
}
int x = Integer.parseInt(str);