help please !
hello I am a beginner in java and I want to solve a problem, I want to do a questionnaire question / answer but my program just shows the last entered value! solution or another suggestion thanks import java.util.Scanner; public class projet2 { static Scanner sc= new Scanner(System.in); public static void main(String[] args) { int x=1,n=3, res=0,ress=0,y=2; String Q; String []tab2=new String[x]; String []tab3=new String[y]; String []tab4=new String[1]; question2(tab2,tab3,tab4,n); System.out.println(); afficher(tab2); afficher(tab3); } //-----------------question---------------- public static void question2(String []tab,String[]tab2, String[]tab3,int n){ String Q; int res=0; while(res<n){ for(int i=0;i<tab.length;i++) { System.out.println(" question"); Q=sc.nextLine(); tab[i]=Q; for(int j=0;j<tab2.length;j++){ System.out.println("Answer"); tab2[j]=sc.nextLine(); } BR(tab3); } res++; } } //-----------------quest---------------- public static void question(String []tab){ String Q; for(int i=0;i<tab.length;i++){ System.out.println("Entrez une question"); Q=sc.nextLine(); tab[i]=Q; } } //-----------------afficher---------------- public static void afficher(String []tab){ for(int i=0;i<tab.length;i++){ System.out.println(tab[i]); } } //-----------------la bonne reponse---------------- public static void BR(String[]tab){ String Q; for(int i=0;i<tab.length;i++){ System.out.println("true answer : "); Q=sc.nextLine(); tab[i]=Q; } } }