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 

Intialize random letters in arraylist

import java.util.ArrayList;
import java.util.Random;


public class Intialization {
    public static void intializeRandomLetter() {
        int randomNum = (int) (Math.random() * (2 - 0 + 1));
        return randomNum;
    }
    public static void main(String[] args) {
        ArrayList<String> letters = new ArrayList<String>();
        
        System.out.println(letters);
    }
}
Intialization.main(null);
|           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