bonsoir a tous le monde j'ai cette erreur no static variable canot referenced from static context
voici mon code
merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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]); } }
Partager