prog to read students particulars such as roll etc from key board using array?
<pre><code>import java. util.*; 
class student
{
    private int rollno;
    private int age;
    private String sex;
    private float height;
    private float weight;

    void getinfo()
    {
        System.out.println("enter the roll no of the student");
        Scanner obj=new Scanner(System.in);
        rollno=obj.nextInt();

        System.out.println("enter the age of student");
        Scanner obj1=new Scanner(System.in);
        age=obj1.nextInt();

        System.out.println("enter the sex of the student");
        Scanner obj3=new Scanner(System.in);
        sex=obj3.nextLine();

        System.out.println("enter the heighrt of student ");
        Scanner obj4=new Scanner(System.in);
        height=obj4.nextFloat();

        System.out.println("enter the weight of the student");
        Scanner obj5=new Scanner(System.in);
        weight=obj5.nextFloat();

    }

    void disinfo()
    {
        System.out.println(rollno);
        System.out.println(age); 
        System.out.println(sex);
        System.out.println(height);
        System.out.println(weight);
    }
}


public class str
{
    public static void main(String[]args)
    {
        student object[]=new student[5];
        System.out.println("enter the number of student");
        int i;
        int n;
        Scanner obj6=new Scanner(System.in);
        n=obj6.nextInt();

        for(i=1;i&lt;n;i++)
        {
            object[i].getinfo();
        }

        System.out.println("diplaying the result");

        for(i=1;i&lt;n;i++)
        {
            object[i].disinfo();
        }


    }
}
</code></pre>
