Java Program to determine whether a given string is palindrome8 Jan 2025 | 2 min read In this program, we need to check whether a given string is palindrome or not. A string is said to be palindrome if it is the same from both the ends. For e.g. above string is a palindrome because if we try to read it from backward, it is same as forward. One of the approach to check this is iterate through the string till middle of string and compare a character from back and forth. ALGORITHM
Program:Output: Given string is palindrome Next TopicJava Programs |
In this program, we need to find the duplicate characters in the string. Great responsibility To find the duplicate character from the string, we count the occurrence of each character in the string. If count is greater than 1, it implies that a character has a duplicate...
3 min read
Program to left rotate the elements of an array In this program, we need to rotate the elements of an array towards the left by the specified number of times. In the left rotation, each element of the array will be shifted to its left by...
3 min read
Linked List can be defined as a collection of objects called nodes that are randomly stored in the memory. A node contains two fields, i.e. data stored at that particular address and the pointer which contains the address of the node in the memory. The last...
2 min read
In this section, we will learn automorphic numbers with examples and also create Java programs that check whether the number is automorphic or not. What is an automorphic number? A number is called an automorphic number if and only if the square of the given number ends with...
3 min read
In this program, we need to find the most repeated word present in given text file. This can be done by opening a file in read mode using file pointer. Read the file line by line. Split a line at a time and store in...
2 min read
Java program to print the following pattern on the console Algorithm: STEP 1: START STEP 2: DEFINE i, j STEP 3: SET n=6 STEP 4: SET i=n. REPEAT STEP 5 to STEP 7 UNTIL i>0. STEP 5: SET j=0. REPEAT STEP 6 UNTIL j STEP 6: PRINT * and SET j=j+1 STEP...
2 min read
In a Jail, a corridor is provided. The length of the corridor is L units. An array lightArr[] is given, which is also of the size L. The lightArr[] contains only to values 0 & 1. At each unit of the corridor a light is given....
14 min read
ASCII acronym for American Standard Code for Information Interchange. It is a 7-bit character set contains 128 (0 to 127) characters. It represents the numerical value of a character. For example, the ASCII value of A is 65. In this section, we will learn how to print...
3 min read
Java program to print the following pattern on the console To accomplish this task, we need to create two loops and the 2nd loop is to be executed according to the first loop. The first loop is responsible for printing the line breaks whereas the second...
1 min read
An array or list inArr of the numbers (either negative or positive) is given. The task is to find the number of smaller elements that exist on the right side of the current element. The following examples are given for a better understanding. Example 1: Input int inArr[] =...
14 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India