public class Keypad {
public int instead;
public static void func() {
int[] keypad = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
String sum = "";
for (int i =10; i > 0; i-- ) {
sum += keypad[i-1] + " ";
}
reverseArray(keypad);
for (int i =10; i > 0; i-- ) {
sum += keypad[i-1] + " ";
}
System.out.println(sum);
}
public static void reverseArray(int[] a) {
int instead = 0;
for (int t = 0; t < a.length/2; t++) {
instead = a[t];
a[t] = a[a.length- t-1];
a[a.length- t-1] = instead;
}
}
public static void main(String[] args) {
func();
}
}
Keypad.main(null);
10 9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9 10
| return randomNum;
incompatible types: unexpected return value
| String randomNum1 = intializeRandomLetter();
incompatible types: void cannot be converted to java.lang.String
| String randomNum2 = intializeRandomLetter();
incompatible types: void cannot be converted to java.lang.String
| String randomNum3 = intializeRandomLetter();
incompatible types: void cannot be converted to java.lang.String