Practical 26


Aim:- Write a program to show java Collection Example.

JAVA Code :-

import java.lang.*;
import java.util.*;

class TestCollection
{
   public static void main(String[] args) {
            List<String> ls=new LinkedList<String>();
            ls.add("Ayush");
            ls.add("Kuldeep");
            ls.add("Sagar");
            ls.add("Priyam");
            Iterator<String> itr = ls.iterator();
            while(itr.hasNext()){
               System.out.println(itr.next());
            }
      }
}

Output:-



No comments:

Post a Comment

Programs

Home Aim:- Write a program to convert rupees to dollar. (60rupees=1 dollar). Aim:- Write a program that calculate percentage marks...