erreur no static variable canot referenced from static context
bonsoir a tous le monde j'ai cette erreur no static variable canot referenced from static context
voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
public class personne
{protected int x;
int y[];
public int[] tableau()
{int t[]=new int[3];
int i;
int n=3;
for (i=0;i<=2;i++)
{System.out.println("lecteturede"+i);
Scanner sc = new Scanner(System.in);
t[i]=sc.nextInt();
}
return(t);
}
public static void main (String arg [])
{ personne p= new personne();
y=p.tableau();/* l'erreur est ici
System.out.print(z[0]);
}
} |
merci d'avance