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 » Page 2

Program for demonstrating the basic structure of a Java program

Suryateja Pericherla Categories: Basic. No Comments on Program for demonstrating the basic structure of a Java program

Aim To write a program for demonstrating the basic structure of a Java program.   Theory A Java program is a collection of one or more classes, in which, one class contains the main method. Before looking at the structure of a Java program, let’s see the structure of a Java class. Structure of a […]

Read the rest of this entry »

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

Suryateja Pericherla 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

Suryateja Pericherla 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

Suryateja Pericherla 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 given number is palindrome or not

Suryateja Pericherla Categories: Basic. No Comments on Java program to find given number is palindrome or not

In this article we will learn to implement a Java program to find given number is palindrome or not. A Java program is provided below which reads a number and prints whether it is a palindrome or not.   A palindrome is one which is same after reversing it. For example, if you take a […]

Read the rest of this entry »

Java program to find the reverse of a given number

Suryateja Pericherla 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 »
Facebook
Twitter
Pinterest
Youtube
Instagram
Blogarama - Blog Directory