what i am trying to do here, is to make it possible for the user to type 2 lines, and then say(or display) whether the string of the first sentence correspond to the string of the second sentence.
so for example:
first sentence:
i will go shopping
second sentence:
Tomorrow, i will go swiming.
" i will go" corresponds in the second sentence. so how can i make the program look for corresponding words, and identify them?
so far , i have written this. but i dont know how to finish.
# 1. import java.io.*;
# 2. class Ex11
# 3. {
# 4.
# 5. public static void main(String[] args)
# 6. {
# 7. Console console=System.console();
# 8. System.out.println("please write a sentence"+" ");
# 9. String Str;
# 10. Str=console.readLine();
# 11.
# 12.
# 13. System.out.println("please write another sentence"+" ");
# 14. String Str2;
# 15. Str2=console.readLine();
# 16. char c=Str.charAt(0);
# 17.
# 18.
# 19. int n1=0;
# 20. int n2=0;
# 21. while (n2<Str.length())
# 22. {Str.charAt(n1);
# 23. n1++;
# 24.
# 25.
# 26. while (n2<Str2.length())
# 27. {Str.charAt(n2);
# 28. n2++;}
# 29.
# 30. }
# 31.
# 32. if(x.equals(x2))
# 33. System.out.println(x);
# 34.
# 35.
# 36. }
#