正如标题所说:我有一个需要调用的方法,但我不确定如何调用。这是方法:
public static int wordOrder(int order, String result1, String result2){
order = result1.compareToIgnoreCase(result2);
if (order == 0){
System.out.println("The words are the same.");
}else if (order > 0){
System.out.println("The order of the words alphabetically is " +result2+ " then " +result1+ ".");
}else{
System.out.println("The order of the words alphabetically is " +result1+ " then " +result2+ ".");
}
return order;
}
我应该如何在 main 方法中调用它?任何帮助都会很棒!谢谢!