0% found this document useful (0 votes)
12 views1 page

Java Student ArrayList Example

Uploaded by

Saniya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Java Student ArrayList Example

Uploaded by

Saniya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import [Link].

*;
class Student{
int rollno;
String name;
int age;
Student (int rollno ,String name , int age )
{
[Link] = rollno;
[Link] = name;
[Link] = age;
}
}
class ArrayListPgm {
public static void main (String[] args){
Student s1 = new student (101,"arun",21);
Student s2 = new student (102,"arjun",25);y
Student s3 = new student (103,"amogh",23);
ArrayList<Student> al=new ArrayList<student>();
Iterator<student> itr=.itrator();
[Link](s1);
[Link](s2);
[Link](s3);
[Link](al);
itr=[Link]();
while ([Link]());
{

Student student= itr. next();


[Link] ([Link] + " " [Link] +" " [Link] );
}
}
}

You might also like