A collection of Java utility programs to demonstrate problem-solving techniques for strings, arrays, and basic programming challenges. Ideal for practice or as references for coding interviews.
Skills Gained:
- String Manipulation
- Array Processing
- Character Frequency Analysis
- Handling Special Characters
- Substring Generation
- Sorting and Reordering Elements
- Iterative Problem Solving
- Debugging Java Programs
- Optimizing Algorithms
- Modular Code Design
-
ReverseString.java: Reverses a given string character by character.
Example:Hello World→dlroW olleH -
ChangeSpecialCharacter.java: Replaces a specific special character with another.
Example:Hello @Japneet→Hello _Japneet -
ReverseSentence.java: Reverses the order of words in a sentence.
Example:Hello I am Japneet→Japneet am I Hello -
FindFirstNonRepeatedCharacter.java: Finds the first non-repeated character in a string.
Example:swiss→w -
RemoveAllSpecialCharacters.java: Removes all special characters from a string.
Example:Hello^^%#$(!)_+ J@apneet→Hello Japneet -
RemoveDuplicateWordsFromSentence.java: Removes duplicate words in a sentence.
Example:Hello I am Japneet Japneet am→Japneet am -
RemoveWhiteSpaces.java: Removes all white spaces from a string.
Example:Hello Japneet→HelloJapneet -
MoveNegativeNumbersToStart.java: Moves all negative numbers to the beginning of an array.
Example:[-1, 2, 3, -4, -7, 8]→[-1, -4, -7, 2, 3, 8] -
FindRepeatingElements.java: Identifies elements that repeat in an array and their counts.
Example:[4, 2, 3, 5, 1, 2, 4]→4: 2 times, 2: 2 times -
ExtractLast4CharactersOfString.java: Extracts the last 4 characters of a string.
Example:swiss→wiss -
FindMaximumDifference.java: Finds the maximum difference between the largest and smallest elements in an array.
Example:[10, 90, 2, 40, 1, 25]→89 -
ReverseEachWord.java: Reverses each word in a string.
Example:Hello World→olleH dlroW -
PrintAllTheSubstrings.java: Prints all substrings of a string.
Example:abc→a, ab, abc, b, bc, c -
FindLargestSmallestAnd2ndLargest.java: Finds the largest, smallest, and second-largest numbers in an array.
Example:[23, 5, 1, 89, 65]→Largest: 89, 2nd Largest: 65, Smallest: 1 -
PrintFirstLetterOfString.java: Extracts and prints the first letter of each word in a string.
Example:Hello I am Japneet→H I a J -
PrintWordsVowelsFrequencyofeachCharacter.java: Prints the total word count, count of vowels, and frequency of each character.
