From your comment, I think your only question is how to use command line arguments to solve the problem:
:
public static void main(String args[])
public static void main(String[] args)
, , . ,
java Anagrams sentence1 sentence2
2. (args[0]) sentence1, (args[1]) sentence2.
, , :
public static void main (String[] args) {
for (String s: args) {
System.out.println(s);
}
}
.