title: how to display entered students info completely at last in given java program
body: <p>without using array.. if number of students = 2 and i'm giving two students information using getdata() and finally i want to display student 1 and student 2 informations. but here only it displays last entered student information i.e student 2 information... can you solve this...!</p>
  
  <pre><code>import java.util.Scanner;
  
  public class StudInfo
  {
  int regno;
  String name,course;
  int eng,tam,mat,tot;
  double avg;
  //*
  void getdata()
  {
  Scanner ip=new Scanner(System.in);
  System.out.print("\n\n Enter Roll No.\t:\t");
  regno=ip.nextInt();
  System.out.print("\n Enter Name   \t:\t");
  name=ip.next();
  System.out.println();
  System.out.print(" Enter Marks [English, Tamil and Maths Marks out of 100] : ");
  eng=ip.nextInt();
  tam=ip.nextInt();
  mat=ip.nextInt();
  }
  //*
  void display()
  {
  tot=eng+tam+mat;
  avg=tot/3;
  System.out.println("\n"+"\n Roll No.\t:\t"+regno+
      "\n Name   \t:\t"+name+
      "\n English\t:\t"+eng+
      "\n Tamil   \t:\t"+tam+
      "\n Maths   \t:\t"+mat+
      "\n Total   \t:\t"+tot+
      "\n Average\t:\t"+avg);
  
  
  System.out.print(" Grade   \t:\t");
  if((eng&gt;=50)&amp;&amp;(tam&gt;=50)&amp;&amp;(mat&gt;=50))
  {
  if(avg&gt;=91) System.out.print("O");
  else if(avg&gt;=81) System.out.print("A");
  else if(avg&gt;=71) System.out.print("B");
  else if (avg&gt;=61) System.out.print("C");
  else if(avg&gt;=51) System.out.print("D");
  else System.out.print("Fail");
  }
  else System.out.print("Fail");
  System.out.println();
  }
  //*
  public static void main(String arg[])
  {
  StudInfo s=new StudInfo();
  int maxs,nos;
  Scanner ip1=new Scanner(System.in);
  System.out.print("\nEnter No. of Students : "); 
  nos=ip1.nextInt();
  for(maxs=1;maxs&lt;=nos;maxs++) 
  {
  System.out.println("\nWelcome to Student database");
  System.out.print("\n Enter Student [ "+maxs+" ] details");
  s.getdata();
  }
  s.display();
  }
  }
  </code></pre>
  
  <p>i want to display entered number of students info.. but here displaying last entered student info.. can you solve this...</p>