Ora funziona

codice:
import java.util.Scanner;

public class Tabella {


    public static void main (String[] args) {
    
    Scanner tastiera = new Scanner(System.in);
    
    int k1, w1;
    int w[] = new int [4];
    int k[] = new int [4];
    int tabella[][]= new int [10][3];
    int riga, colonna;
    riga = 0;


    for (w1=0; w1<w.length; w1++)
        w[w1] = tastiera.nextInt();
    System.out.println("Hai completato il primo array!");
    
        
    
    for (k1=0; k1<k.length; k1++)
        k[k1] = tastiera.nextInt();
    System.out.println("Hai completato il secondo array!");
    
    
    for (w1=0; w1<w.length; w1++) {
        for (k1=0; k1<k.length; k1++)
        confronto(w[w1], k[k1], w1, k1, tabella, riga); 
        riga++;
        }    
        
    String [] intestazione = new String [3];
    intestazione [0] = "Valore";
    intestazione [1] = "Indice (1)";
    intestazione [2] = "Indice (2)";
    for(int i=0; i<3; i++)
        System.out.print(intestazione[i] + "  ");
        System.out.println();
    
    for (riga=0; riga<10; riga++){
        for (colonna=0; colonna<3; colonna++) {
            System.out.print(tabella[riga][colonna]+"           ");
        }
        System.out.println();
    }
    
    }


    public static void confronto(int n1, int n2, int pos1, int pos2, int [][] tabella, int riga) {
        if (n1==n2) {
            valore(n1, riga, tabella, pos1, pos2);
            
            }
        }
        
    public static void valore (int n1, int riga, int [][] tabella, int pos1, int pos2) {
        tabella[riga][0] = n1;
        posK(pos1, riga, tabella, pos2);
        }
        
    public static void posK (int pos1, int riga, int [][] tabella, int pos2) {
        tabella[riga][1] = pos1;
        posW(pos2, riga, tabella);
        }
        
    public static int [][] posW (int pos2, int riga, int [][] tabella) {
        tabella[riga][2] = pos2;
        return tabella;
        }
        
}
l'unica cosa è che non riesco a fare... è creare ogni volta che trova una corrispondenza (n1==n2) una nuova riga per la matrice....