String Programs in Java with Output

The string is the most widely used class in java programming. That’s why String programs are used in java interviews to access the coding skills.

String Programs in Java with Output

Here is a list of String Programs with output. The source code from these String programs was well tested in our development environment. We have used JDK 8 or later to develop these programs.
  1. Java Program to Count Number of Duplicate Words in String
  2. Java Program to Count Number of Words in Given String
  3. Java Program to Count the Number of Occurrences of Substring in a String
  4. Java Program to Count the Occurrences of Each Character in String
  5. Java Program to Merge two String Arrays  
  6. Java Program to Remove Duplicate Words from String 
  7. Java Program to Reverse a String(5 ways)
  8. Java Program to Reverse Each Word of a String    
  9. Java Program to Swap Two Strings      
  10. How to Check if the String Contains only Digits         
  11. How to Check if the String Contains only Letters  
  12. How to Check If the String Contains Only Letters or Digits 
  13. Java Program to Check if Input String is Palindrome 
  14. Java Program to Find all Permutations of String
  15. How to Remove or Trim All White Spaces from a String in Java
  16. How to Remove Leading and Trailing White Space From a String in Java
  17. Java Program to Count Duplicate Characters in a String
  18. Remove Character from String in Java (Java 8)
  19. Java Program to Count Vowels and Consonants in a String (Java 8)
  20. 4 Ways to Find First Non-Repeated Character in String in Java
You may be interested to learn String examples. Check out below String conversion examples.

Java String Conversion Examples

Conversion from String to Wrapper classes or Primitive types
  1. Java Convert Integer to String Example
  2. Java Convert Float to String Example
  3. Java Convert Double to String Example
  4. Java Convert Short to String Example
  5. Java Convert Long to String Example
  6. Java Convert Character to String Example
  7. Java Convert Byte to String Example
  8. Java Convert Boolean to String Example
Conversion from Wrapper classes or Primitive types to String
  1. Java Convert String To Short Example
  2. Java Convert String To Long Example
  3. Java Convert String To Integer Example
  4. Java Convert String To Float Example
  5. Java Convert String To Double Example
  6. Java Convert String To Byte Example
  7. Java Convert String To Boolean Example

Free Spring Boot Tutorial | Full In-depth Course | Learn Spring Boot in 10 Hours


Watch this course on YouTube at Spring Boot Tutorial | Fee 10 Hours Full Course

Comments