0% found this document useful (0 votes)
19 views2 pages

Java Programs (Collection & String)

Uploaded by

VIKRAM verma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
19 views2 pages

Java Programs (Collection & String)

Uploaded by

VIKRAM verma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

Collections

1. Program: How to copy or clone a ArrayList?


2. Program: How to find does ArrayList contains all list elements or not?
3. Program: How to copy ArrayList to array?
4. Program: How to shuffle elements in ArrayList?
5. Program: How to swap two elements in a ArrayList?
6. Program: How to copy LinkedList to array?
7. Program: How to get sub list from LinkedList?
8. Program: How to reverse LinkedList content?
9. Program: How to read first element from LinkedList?
10. Program: How to read last element from LinkedList?
11. Program: How to iterate through LinkedList in reverse order?
12. Program: How to copy Set content to another HashSet? 13. Program: How to compare two
sets and retain elements which are same on both sets?
14. Program: How to copy Map content to another HashMap?
15. Program: How to search a key in HashMap?
16. Program: How to search a value in HashMap?
17. Program: How to get all keys from HashMap?
18. Program: How to get entry set from HashMap?
19. Program: How to delete all elements from HashMap?
20. Program: Write a program to remove duplicate entries from an array.
21. Program: Write a program to find duplicate value from an array.
22. Program: How to get subset from sorted set?
23. Program: How to copy Map content to another TreeMap?
24. Program: How to search a key in TreeMap?
25. Program: How to search a value in TreeMap?
26. Program: How to get all keys from TreeMap?
27. Program: How to get entry set from TreeMap?
28. Program: How to get sorted sub-map from TreeMap?
29. Program: How to get first key element from TreeMap (Sorted Map)?
30. Program: How to reverse sorted keys in a TreeMap?
31. Program: How to create synchronized list?
32. Program: How to create synchronized set?
33. Program: How to create synchronized map?
34. Program: How to get max element from the given list?
Strings

1. Write a program to reverse a String

2. Write a program to reverse a String with recursive algorithm?

3. Write a program to reverse first half separately and 2nd half separately?

4. Write a program to rotate one char in a given string

5. Find out length of the string without length() method of a String?

6. Find out how many words are there in a given string?

7. Write a java program to find the duplicate words and their number of occurrences in
a string?

8. Write a program to reverse the given string word wise?

9. Rotate the string word wise by one

10. Write a java program to count the total number of occurrences of a given character
in a string?

11. Write a java program to count the number of occurrences of each character in
a string?

12. Write a java program to remove all white spaces from a string?

13. Write a program to check whether given string is a palindrome or not?

14. Write a program to check whether given two strings are anagrams?
15. Write a java program to reverse each word of a given string?

You might also like