Dear group,
Extract the integer value and cahr present in a given string. So I tried
the following:
import java.io.*;
public class p198
{
public static void main (String[] args)
{
System.out.println("Type some text and press");
int j;
String string = "";
InputStreamReader input = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(input);
try
{
string = reader.readLine();
}
catch(Exception e){}
try
{
j = Integer.parseInt(string);
System.out. println(j);
}catch(NumberFormatException e){}
}
}
I can only get through the half way. can any one guide me by giving some
key word to search the google for the above?
I am just started to learn java, thanks