import java.util.Scanner;
public class Return {
static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
inputTest();
}
public static void inputTest(){
System.out.println("From Digit (9635)");
System.out.print("Enter a Digit: ");
int number = input.nextInt();
System.out.println(Digit(number));
}
public static int Digit(int number) {
if (number == 1) {
System.out.print("The 4th number in the argument is =\t");
return 5;
} else if (number == 2) {
System.out.print("The 3rd number in the argument is =\t");
return 3;
} else if (number == 3) {
System.out.print("The 2nd number in the argument is =\t");
return 6;
} else if (number == 4) {
System.out.print("The 1st number in the argument is =\t");
return 9;
} else {
System.out.print("Sorry! That's not part of the argument =\t");
**return 0;**
}
}
}
/* 是否可以在同一个方法中使用 (string, int) 来获取返回 (string) 和返回 (int)??我希望那个 return 0(int) 变成 return none(String) */