import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {
    int tama=5;
    llenarmatriz(tama);

    public static void llenarmatriz(int x);
        Random aleatorio = New Random(System.currentTimeMillis());
        String abc[][] = new String [x][x];
        for(int filas=0; filas<x;filas++)
            for (int columnas=0; columnas < x; columnas ++)

        int intAleatorio = aleatorio.nextInt(100);
        // abc[filas][columnas]=""+intAleatorio;
        abc[filas][columnas]=String.valoueOf(intAleatorio);
        
    }
}

// JOptionPane.showMessageDialog(null, abc);

public stativ void equiz(int x, String arreglo2D[][])
{
    String jjoo="";
    int f=x, c=x;
    int otraV = x+1;
    for (int fila = 0; fila< f; fila++) {

    for (int colu = 0; colu < c; colu++) {

        if (fila == colu || otraV == colu) {
             
           jjoo = jjoo + " .  " + "------";

           if (otraV == colu) {
               otraV--;
           }       
} else {
    jjoo = jjoo + " . " + arreglo2D[fila][colu];
     }

    }

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: