Write a code to check whether one string is a rotation of another?7 Jan 2025 | 1 min read File: RotationString .java Output: Checking if a string is rotation of another Yes javaava is rotation of avajavaw |
In this program, we will create a circular linked list and print all the nodes present in the list. Circular Linked List: The circular linked list is a kind of linked list. First thing first, the node is an element of the list, and it has two...
4 min read
In this program, we need to find out the minimum and maximum value node in the given singly linked list. We will maintain two variables min and max. Min will hold minimum value node, and max will hold maximum value node. In the above example, 1...
6 min read
Seven segments display is an output display device. It provides a way to display information in the form of images, text, or decimal numbers. It is an alternative to complex dot matrix displays. Seven segment displays are widely used in digital or electronic devices like calculators,...
8 min read
Java String to Date We can convert String to Date in java using parse() method of DateFormat and SimpleDateFormat classes. To learn this concept well, you should visit DateFormat and SimpleDateFormat classes. Java String to Date Example Let's see the simple code to convert String to Date in java. import java.text.SimpleDateFormat; import...
2 min read
How to Reverse a String in Java Word by Word In this section, we reverse a string in Java word by word. Example 1: Reverse a string word by word using recursion import java.util.Scanner; public class ReverseStringExample1 { public static void main(String[] args) { String str; System.out.println("Enter a string: "); Scanner scanner =...
1 min read
Program to print the elements of an array present on odd position In this program, we need to print the elements of the array which are present in odd positions. This can be accomplished by looping through the array and printing the elements of an array...
1 min read
In this program, we need to find out the maximum width of the binary tree. The width of the binary tree is the number of nodes present in any level. So, the level which has the maximum number of nodes will be the maximum width...
6 min read
Java Convert int to double We can convert int to double in java using assignment operator. There is nothing to do extra because lower type can be converted to higher type implicitly. It is also known as implicit type casting or type promotion. Java int to double Example Let's...
1 min read
In this program, we create a doubly linked list and insert a new node in the middle of list. If list is empty, both head and tail will point to new node. If list is not empty, then we will calculate the size of the...
8 min read
Java Convert Date to Timestamp We can convert Date to Timestamp in java using constructor of java.sql.Timestamp class. The constructor of Timestamp class receives long value as an argument. So you need to convert date into long value using getTime() method of java.util.Date class. You can also format the...
2 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