Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.
Home » Programming » Java » Programs » Strings

Java program to print all unique words of a string

Suryateja Pericherla Categories: Strings. 5 Comments on Java program to print all unique words of a string

In this article we will learn to implement a java program to print all unique words of a string. A java program is provided below which reads a line of text from the user and prints out the unique words in ascending order.   We use TreeMap class from collections framework to store the frequency […]

Read the rest of this entry »

Java program to print only unique characters in a string

Suryateja Pericherla Categories: Strings. No Comments on Java program to print only unique characters in a string

In this article we will learn to implement a Java program to print only unique characters in a string. A Java program is provided below which reads a string from the user, and prints out only the unique characters in the string in insertion order.   First we find out the frequency of each character […]

Read the rest of this entry »

Java program to print the frequency of characters in a string

Suryateja Pericherla Categories: Strings. No Comments on Java program to print the frequency of characters in a string

In this article we will learn to implement a Java program to print the frequency of characters in a string. A Java program is provided below reads the string and gives the frequency of each character (number of times a character is repeated).   This java program reads a string from the user, calculates frequency […]

Read the rest of this entry »

Java program to remove duplicate characters from a string

Suryateja Pericherla Categories: Strings. 2 Comments on Java program to remove duplicate characters from a string

In this article we will learn to implement a Java program to remove duplicate characters from a string. A java program is provided below that accepts a string from the user, ignores any duplicate characters and prints each character only once in ascending order.   We use TreeSet class from collections framework for printing the characters […]

Read the rest of this entry »

Java program to display integers and sum using StringTokenizer

Suryateja Pericherla Categories: Strings. No Comments on Java program to display integers and sum using StringTokenizer

In this article we will learn to implement a Java program to display integers and their sum using StringTokenizer. A Java program is provided below which uses StringTokenizer class, reads a line of integers and then displays each integer and the sum of all integers.   Program is as follows: import java.util.*; class StringTokenDemo { […]

Read the rest of this entry »

Java program for sorting a given list of names in ascending order

Suryateja Pericherla Categories: Strings. No Comments on Java program for sorting a given list of names in ascending order

In this article we will learn to implement a Java program for sorting a given list of names in ascending order. A Java program is provided for sorting a given list of names or strings in ascending order.   Program is as follows: import java.util.*; class Sorting { void sortStrings() { Scanner s = new […]

Read the rest of this entry »

Java program that checks whether a given string is a palindrome or not

Suryateja Pericherla Categories: Strings. 1 Comment on Java program that checks whether a given string is a palindrome or not

In this article we will learn to implement a Java program that checks whether a given string is a palindrome or not. A Java program is provided below that reads a string, checks whether it is a palindrome or not.   Program is as follows: import java.util.*; class Palindrome { void isPalindrome(String str) { String […]

Read the rest of this entry »
Facebook
Twitter
Pinterest
Youtube
Instagram
Blogarama - Blog Directory