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

Java Program Sem-II

The document contains a list of ten Java programming tasks that involve various data structures such as HashSet, LinkedList, and TreeSet. Each task focuses on specific operations like adding, deleting, and displaying elements while ensuring no duplicates are stored. The tasks also include user input handling and the use of iterators for displaying collection contents.

Uploaded by

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

Java Program Sem-II

The document contains a list of ten Java programming tasks that involve various data structures such as HashSet, LinkedList, and TreeSet. Each task focuses on specific operations like adding, deleting, and displaying elements while ensuring no duplicates are stored. The tasks also include user input handling and the use of iterators for displaying collection contents.

Uploaded by

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

JAVA PROGRAM LIST

1. Write a java program to read ‘N’ names of your friends, store it into HashSet and
display them in ascending order.
2. Write a Java program to create LinkedList of String objects and perform the
following: i. Add element at the end of the list ii. Delete first element of the list iii.
Display the contents of list in reverse order.
3. Write a Java program to store city names and their STD codes using an appropriate
collection and perform following operations: i. Add a new city and its code (No
duplicates) ii. Remove a city from the collection iii. Search for a city name and
display the code
4. Write a Java program to accept ‘n’ integers from the user and store them in a
collection. Display them in the sorted order. The collection should not accept
duplicate elements. (Use a suitable collection). Search for a particular element using
predefined search method in the Collection framework.
5. Write a java program to create a TreeSet, add some colors (String) and print out the
content of TreeSet in ascending order.
6. Write a java program to accept ‘N’ integers from a user. Store and display integers in
sorted order having proper collection class. The collection should not accept
duplicate elements.
7. Write a java program to accept ‘N’ Integers from a user store them into LinkedList
Collection and display only negative integers.
8. Write a java program to accept ‘N’ Subject Names from a user store them into
LinkedList Collection and Display them by using Iterator interface.
9. Write a Java program to create LinkedList of integer objects and perform the
following: i. Add element at first position ii. Delete last element iii. Display the size of
link list
10. Write a java program to accept ‘N’ student names through command line, store them
into the appropriate Collection and display them by using Iterator and ListIterator
interface.

You might also like