Java program to print the following pattern8 Jan 2025 | 1 min read 5432* Algorithm:
Program:Output: 5432* 543*1 54*21 5*321 *4321 Next TopicJava Programs |
Java Convert Timestamp to Date We can convert Timestamp to Date in java using constructor of java.util.Date class. The constructor of Date class receives long value as an argument. So, you need to convert Timestamp object into long value using getTime() method of java.sql.Timestamp class. Let's see the constructor...
2 min read
It is a very interesting problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, Accenture, etc. By solving the problem, one wants to check the logical ability, critical thinking, and problem-solving skill of the interviewee. So, in this section, we are going...
7 min read
12344321 123**321 12****21 1******1 Algorithm: STEP 1: START STEP 2: SET lines=4 STEP 3: DEFINE i, j. STEP 4: SET space=0 STEP 5: SET i=0 STEP 6: REPEAT STEP 7 TO 20 UNTIL i STEP 7: SET j=1 STEP 8: REPEAT STEP 9 UNTIL j <= space. STEP 9: PRINT " " and SET J=J+1 STEP 10: SET...
2 min read
Write a ? File: RemoveChar .java public class ReverseStringPreserveSpace { static void reverseString(String input) { char[] inputArray = input.toCharArray(); char[] result = new char[inputArray.length]; for (int i = 0; i < inputArray.length; i++) { if (inputArray[i] == ' ') { result[i] = ' '; } } int j = result.length - 1; for...
1 min read
In this program, we will create a doubly linked list and count the number of nodes present in the list. To count the node, we traverse through the list by incrementing the counter by 1. What count of nodes presents above doubly linked list is 5. Algorithm Define...
5 min read
In this program, our task is to remove all the white-spaces from the string. For this purpose, we need to traverse the string and check if any character of the string is matched with a white-space character or not. If so, use any built-in method...
2 min read
An array containing various numbers is given. The task is to create different groups, each containing only two elements, such that the difference between the group containing the largest sum and the group containing the lowest sum should be minimum. Note that any element can only...
5 min read
In this section, we will learn what is a bouncy number and also create Java programs to check if the given number is bouncy. The bouncy number program frequently asked in Java coding tests and academics. Before understanding the bouncy number, first, we will understand what...
4 min read
In this program, we will find out the largest node in the given binary tree. We first define variable max that will hold root's data. Then, we traverse through the left sub-tree to find the largest node. Compare it with max and store the maximum...
5 min read
Program to print smallest and biggest possible palindrome word in a given string In this program, we need to find the smallest and biggest palindromic word present in the given string. Wow you own kayak In above example, wow represent the smallest palindrome and kayak represent the biggest...
3 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