hi!,
can anyone help me because I don't know about this but I try it but it won't work their is an error and I don't know how, Please Help me...
my problem is that once I Enter a Real Number the word Valid will display and if it is not a Real Number the word Invalid will display and I have a Java Code on it but the problem it that it won't work and can anyone help me on this, Please...
Thank You Very Much if anyone can help me on this...
And the Java Code is here:, If anyone see this Please Help Me what's the problem of my Java Code: Please...
import java.io.*;
import java.util.StringTokenizer;
public class Az
{
static BufferedReader n=new BufferedReader
(new InputStreamReader(System.in));
private String words[] = new String[0];
private String desc[] = {"0"};
private String reserve[] = {"0"};
private int wordcount;
private String output = "";
public static void main(String[]args)throws IOException
{
String entry ="";
Az az = new Az();
while(true)
{
System.out.print("\nEnter Expression: ");
entry = String.valueOf(n.readLine());
az.TokenizeString(entry);
}
}
public void TokenizeString(String entry)
{
StringTokenizer st = new StringTokenizer(entry);
int i=0;
wordcount = st.countTokens();
while(st.hasMoreTokens())
{ words[i] = st.nextToken(); i++;
String description = "Valid";
}
for(int x=0;x<wordcount;x++)
{ System.out.println("[" +words[x]+ "]: " +Descriptor(words[x])); }
}
public String Descriptor(String word)
{
String description = "Invalid";
int x,y;
for(x=0;x<reserve.length;x++)
{
if(word.equalsIgnoreCase(reserve[x]))
{ description = desc[x]; }
}
return description;
}
}


Reply With Quote



Bookmarks