Salve a tutti,
ho un problema di compilazione.
La classe Magazzino(contenente il main) al momento di compilare mi dà questo errore:
>javac Magazzino.java
Magazzino.java:53: cannot find symbol
symbol : constructor Etichetta(java.util.Date,int,char[])
location: class Etichetta
new Etichetta(data,(int)(Math.random()*100), colore), (double)(Math.random()*100.0));
^
Magazzino.java:60: cannot find symbol
symbol : constructor Etichetta(java.util.Date,int,char[])
location: class Etichetta
new Etichetta(data,(int)(Math.random()*100), colore),(int)(Math.random()*31 + 1));
^
Magazzino.java:67: cannot find symbol
symbol : constructor Etichetta(java.util.Date,int,char[])
location: class Etichetta
new Etichetta(data, (int)(Math.random()*100), colore),
^
3 errors
>Exit code: 1
Il codice della classe interessata è questo:
codice:
import java.util.Date;
import java.util.GregorianCalendar;
public class Magazzino
{
Object cinghie [];
Date today;
char colore[] = new char[5];
public Magazzino()
{
cinghie = new Object[33];
Object cinghie[] = Stampa();
for(int i = 0; i < cinghie.length; i ++)
{
System.out.println(cinghie[i]);
}
}
public Object[] Stampa()
{
int temp = 0;
for(int i = 0; i < cinghie.length; i++)
{
temp = (int)(Math.random()*4);
Date data = new GregorianCalendar((int)(Math.random()*12 + 1),
(int)(Math.random()*31 + 1),
(int)(Math.random()*108 + 1900)).getTime();
Date today = new Date();
long diff = today.getTime() - data.getTime();
long delta = diff /(1000 * 60 * 60 * 24);
for(int j = 0; j < 5; j++)
{
colore[j] = (char)(Math.random()*100);
}
switch(temp)
{
case 0:
{
cinghie[i] = new Elastiche((int)(Math.random()*100), (double)(Math.random()*100.0));
break;
}
case 1:
{
cinghie[i] = new Fibra((int)(Math.random()*100), (int)(Math.random()*100),
new Etichetta(data,(int)(Math.random()*100), colore), (double)(Math.random()*100.0));
break;
}
case 2:
{
cinghie[i] = new Catene((int)(Math.random()*100),(int)(Math.random()*100),
new Etichetta(data,(int)(Math.random()*100), colore),(int)(Math.random()*31 + 1));
break;
}
case 3:
{
cinghie[i] = new Rinforzate((int)(Math.random()*100), (int)(Math.random()*100),
new Etichetta(data, (int)(Math.random()*100), colore),
(double)(Math.random()*100.0), (double)(Math.random()*100.0));
break;
}
}
}
return cinghie;
}
public static void main(String args[])
{
Magazzino start = new Magazzino();
}
}
La classe Etichetta è questa:
codice:
public class Etichetta
{
private Data data;
private int codice;
private char colore[];
private int delta;
public Etichetta(Data data, int codice, char colore[])
{
super();
this.data = data;
this.codice = codice;
this.colore = colore;
}
public Data getData()
{
return data;
}
public int getCodice()
{
return codice;
}
public char [] getColore()
{
return colore;
}
public int getDelta()
{
return delta;
}
}