public class Alfabhto {
String[] gramata ={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
int[][] pinakas = new int[3][6];
public class Numbers extends Alfabhto {
public Numbers(){
for (int i=0;i<=3;i++)
{
for (int j=0;j<=6;j++)
{
Random rand = new Random();
pinakas[i][j] = rand.nextInt(38)-12;
System.out.println(pinakas[i][j]);
}
}
}
}
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter an alphanumeric combination");
String fail = s.nextLine();
}
}
First of all, I am very new at java. The main function works properly and the user is asked to give an input. Some elements aren't used here (like the gramata array) so ignore them.
The problem is: the subclass numbers should fill the pinakas array with random numbers and then print them. It does nothing. No errors in general. Any ideas?
Aucun commentaire:
Enregistrer un commentaire