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.

Java program to print only unique characters in a string

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

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

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 reverse the array inplace

Categories: Arrays. 2 Comments on Java program to reverse the array inplace

In this article we will learn to implement a Java program to reverse the array. A Java program is provided below which reverses an array in-place (without using extra memory).   Following program reads an array of elements and reverses the array in place i.e., without using any temporary array: import java.util.Scanner; public class Driver […]

Read the rest of this entry »

Java program to find the maximum and minimum value of an array

Categories: Arrays. No Comments on Java program to find the maximum and minimum value of an array

In this article we will learn to implement a Java program to find the maximum and minimum value of an array. A java program is provided below which reads array elements from the user and finds out the maximum, minimum elements in the array.   Program is as follows: import java.util.Scanner; public class Driver { […]

Read the rest of this entry »

Java program to check whether the number is an armstrong number or not

Categories: Basic. No Comments on Java program to check whether the number is an armstrong number or not

In this article we will learn to implement a Java program to check whether the number is an armstrong number or not.   Armstrong number is one in which the sum of the cubes of individual digits is same as the given number. For example if you take the number 153, (1^3) + (5^3) + […]

Read the rest of this entry »

Java program to find the reverse of a given number

Categories: Basic. No Comments on Java program to find the reverse of a given number

In this article we will learn to implement a Java program to find the reverse of a given number. A Java program is provided below which reads a number from the user and prints the reverse of that number:   Program is as follows: import java.util.Scanner; public class Driver { public static void main(String[] args) […]

Read the rest of this entry »

Java program to find the factorial of a number using recursion

Categories: Basic. No Comments on Java program to find the factorial of a number using recursion

In this article we will learn to implement a Java program to find the factorial of a number using recursion. A Java program is provided below to read a number and print the factorial of that number.   Following program reads a number form the user and prints its factorial using recursion: import java.util.Scanner; public […]

Read the rest of this entry »