Master the Collection Framework in 7 days - Example of HashSet, LinkedHashSet, TreeSet

preview_player
Показать описание
Are you ready to take your Java skills to the next level? Join our 7-Day Mini Challenge and dive deep into the Collection Framework like never before!

Today is Day-04.
In todays challenge, let us learn about Set and its implementation classes

Day:04 Tasks
Basic
1.a HashSet with Integer values clone it to another HashSet .
2. a HashSet with String names convert a HashSet to a TreeSet
3. a HashSet with String names, reverse the names and create a reverse order view of the elements
4a. find the numbers less than 50 in TreeSet
4b. find the numbers greater than 50 in TreeSet
5a. In a TreeSet of Integer values, get the element which is greater than or = to the given element.
5b. In a TreeSet of Integer values, get the element which is less than or = to the given element.
6a. In a TreeSet of Integer values, get the element strictly greater than the given element.
6b. In a TreeSet of Integer values, get the element strictly lesser than the given element.
7. In a TreeSet with names, reverse and print it
8. In a TreeSet with names, retrieve and remove the first element and last element of a tree set.
9. In a TreeSet with names, print the first and the last element of a tree set.
10. Write a program to remove duplicate strings from an array and store the unique strings in a HashSet.

Advanced
11. Given two HashSet with course names webcourses

a. compare the sets and retain elements that are the same output: web[HTML,REACT]
b. difference (elements that are in one set but not both)print them output: [Spring, Java, CSS]

12. Write a program that reads a paragraph of text, splits it into words, and uses a HashSet to count the number of distinct words
Input: "Java is fun. Java is powerful."
Output: count: 5 distinct words: [Java, is, fun, powerful]

13. Write a program to group strings by their first letter using a TreeSet.
Input is a list: ["apple", "banana", "apricot", "cherry", "blueberry"]
Output should be 3 sets as: ["apple", "apricot"], ["banana", "blueberry"], ["cherry"]

14.Write a program to find the longest string from a set and store all strings of the same length in a HashSet.
Input Example: ["java", "javascript", "python", "kotlin","react","scss"]
Output: prints javascript and the set with strings of same length["python","kotlin","react"] ["java","scss"]

15.Write a program to remove all strings from a HashSet that start with a specific letter (e.g., 'a').
Input: ["apple", "banana", "avocado", "cherry"]
Output (remove 'a'): ["banana", "cherry"]

___________________________________________________________________________
🔑 What You'll Learn:
✅ Introduction to Collection Framework
✅ ArrayList, LinkedList, Set, TreeSet, HashMap, TreeMap, and more
✅ How to choose the right collection for your use case
✅ Real-world coding scenarios and challenges

💡 Why This Challenge?
In just 7 days, you'll gain the confidence and knowledge to master one of the most essential topics for Java developers.

This mini-series is designed to provide a hands-on learning experience through task-based challenges.
______________________________________________________________________

Complete the daily tasks and share your answers in the comments or in my private community

Join my private paid community to collaborate with passionate learners like you to build skills, solve challenges and grow as developers

Shristi Dev Circle

Learn, Code, Grow together
Duration: 6 Months

Here's what you’ll get as part of this community

👉 Weekly Live Q & A Group Call:
Join me, every Saturday for a live group call to discuss and get your doubts clarified related to Java Full Stack.
👉 Learn from Industry Experts:
Regular Webinars from Industry Domain Experts on different topics
👉 Save on Premium Learning:
10% off on all our paid programs and courses
👉 Exclusive Community for Discussions

Bonus:
👉 Career Counseling Tailored to You:
One free session to discuss your career goals. Let’s work together to create a clear, actionable plan to advance your career!

This membership is your gateway to exclusive knowledge, expert advice, and a supportive network to propel your career forward. Join us and take your learning and professional journey to the next level!
_______________________________________________________________________

To learn more about our courses, Connect

#springframeworkforbeginners
#shristitechacademyjava
#shristitechacademyspring
#springtutorialbyshristi
Рекомендации по теме
Комментарии
Автор

Hi Ma’am you doing great job. Thank you

kingajable
welcome to shbcf.ru