#need help understanding the parts of implementing an interface, this is hw not looking 4 solution
8 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @wind badger! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Are you comparing the area ?
or what exactly are you comparing between the different shapes ?
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.InputMismatchException;
public class CompareFiles {
public static void main(String[] args) {
try(BufferedReader file1 = new BufferedReader(new FileReader("")); BufferedReader file2 = new BufferedReader(new FileReader(""))) {
String line;
while((line = file1.readLine()) != null) {
if(!line.strip().equals(file2.readLine().strip())) {
throw new InputMismatchException("Files do not match");
}
}
} catch(IOException e) {
throw new InputMismatchException("Files do not match");
}
}
}
Before your post will be closed, would you like to express your gratitude to any of the people who helped you? When you're done, click I'm done here. Close this post!.