Java Programming Question:

String:

1. Write a Java program to reverse a given string without using any built-in methods.
2. Create a Java method that takes a string as input and returns the number of vowels present in it.
3. Write a Java function to check if two given strings are anagrams of each other.
4. Write a Java program that counts the occurrences of a specific word in a given text.
5. Create a Java method to remove all the spaces from a given string.
6. Write a Java function to find the longest word in a given sentence.
7. Implement a Java program that checks if a string is a valid palindrome (reads the same forwards and backward, ignoring spaces and punctuation).
8. Write a Java function to convert a given string to title case (the first letter of each word capitalized).
9. Create a Java program that finds and prints all duplicate characters in a given string.
10. Implement a Java method that takes two strings as input and returns the common characters between them.


Array:

11. Write a Java program to find the sum of all elements in an integer array.
12. Given an array of integers, write a Java program to find the maximum and minimum elements in the array.
13. Write a Java program to find the average of elements in a floating-point array.
14. Given an array of integers, write a Java program to check if it is sorted in ascending order.
15. Write a Java program to reverse the elements of an integer array.
16. Given two arrays of the same length, write a Java program to find the element-wise sum of the arrays.
17. Write a Java program to remove duplicate elements from an array of integers.
18. Given a two-dimensional array, write a Java program to find the transpose of the array.
19. Write a Java program to rotate the elements of an array to the left by a given number of positions.
20. Given an array of integers, write a Java program to find the second-largest element in the array.


ArrayList:

21. Write a Java program to create an ArrayList of integers and add elements to it. Then, find the sum of all the elements in the ArrayList.
22. Given an ArrayList of strings, write a Java program to count the number of occurrences of a specific word in the list.
23. Write a Java program to remove all duplicate elements from an ArrayList of integers.
24. Given two ArrayLists of integers, write a Java program to find the common elements between them.
25. Write a Java program to reverse the elements in an ArrayList.
26. Given an ArrayList of strings, write a Java program to find the longest and shortest strings in the list.
27. Write a Java program that takes an ArrayList of integers as input and returns a new ArrayList containing only the even numbers from the original list.
28. Given an ArrayList of characters, write a Java program to check if it is a palindrome (reads the same forwards and backwards).
29. Write a Java program to shuffle the elements in an ArrayList randomly.
30. Given an ArrayList of integers, write a Java program to find the second-largest and second-smallest elements in the list.