如何将此方法调用到我的主要方法中:
public static char shiftLetter(char aLetter, int offset){
if((aLetter >= 65 && aLetter <= 90) || (aLetter >=97 && aLetter <=122)){
char shifted = (char) (aLetter + offset);
return shifted;
}else{
return aLetter;
}
}
这是我的主要方法:
public static void main(String[]args){
Scanner in = new Scanner (System.in);
String isAnswer = askQ();
if (isAnswer.equals("encode") || isAnswer.equals("decode")){
String text = isText();
int offset = isOffset();
char[] myString = text.toCharArray();
System.out.println(myString);