Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Debugging

  Asked By: Jose    Date: Apr 27    Category: Java    Views: 602
  

Can Anyone help me with these, thx....
C:\jdk1.3.1\bin>javac StringCompare.java
StringCompare.java:4: ';' expected
public static void main (String args[]) throws IO Exception {
^
StringCompare.java:4: cannot resolve symbol
symbol : class IO
location: class StringCompare
public static void main (String args[]) throws IO Exception {
^
StringCompare.java:4: missing method body, or declare abstract
public static void main (String args[]) throws IO Exception {

*********************************************************************
import java.io.*;

public class StringCompare {
public static void main (String args[]) throws IO Exception {

String s1;
String s2;

system.out.println ("Please enter first string");
s1=KeyBoard.readint();

system.out.println ("Please enter second string");
s2=KeyBoard.readint ();

int result = s1.compareTo(s2);
if (result == 0)
System.out.println("s1 = s2");
else if (result < 0)
System.out.println("s1 < s2");
else // if (result > 0)
System.out.println("s1 > s2");
}
}

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Harold Graham     Answered On: Apr 27

There should not be any apace between IOException. it is name of the
class.

Then change system  to System.
what is KeyBoard???

 
Didn't find what you were looking for? Find more on Debugging Or get search suggestion and latest updates.




Tagged: