- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2616 Articles for Java
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
534 Views
In this article, we will understand how to rotate matrix elements. A matrix is representation of the elements in rows and columns. Matrix rotation is shifting the position of each element of the matrix by 1 position towards it’s right or left.Below is a demonstration of the same −Suppose our input is −The matrix is defined as 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16The desired output would be −The matrix after one rotation: 5 1 2 3 9 10 6 4 13 11 7 8 14 15 16 12AlgorithmStep 1 - ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
In this article, we will understand how to print boundary elements of a matrix. A matrix is representation of the elements in rows and columns. Boundary elements are those elements which are not surrounded by elements on all four directions. For example, the elements in the first row, first column, last row and last column.Below is a demonstration of the same −Suppose our input is −The input matrix: 9 8 9 8 8 7 8 7 7 6 7 6 6 5 6 5The desired output would be −The border elements of the matrix is: 9 8 9 8 8 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
In this article, we will understand how to calculate standard deviation. The standard deviation is the measure of how spread-out numbers are. The symbol of standard deviation is sigma( σ ). It is the square root of variance. Standard deviation is computed using the formula square root of ∑(Xi - ų)2 / N where Xi is the element of the array, ų is mean of the elements of the array, N is the number of elements, ∑ is the sum of the each element. Problem Statement Given a program in Java to calculate the standard deviation of a given ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
8K+ Views
In this article, we will understand how to print X star pattern. The pattern is formed by using multiple for-loops and print statements. Below is a demonstration of the same: − Input Suppose our input is − Enter the number : 8 Output The desired output would be − The X star pattern : X X X X X X X X X X ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
890 Views
In this article, we will understand how to print half diamond star pattern. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the number of rows : 8OutputThe desired output would be −The half diamond pattern : * ** *** **** ***** ****** ******* ******** ******* ****** ***** **** *** ** *AlgorithmStep 1 - START Step 2 - Declare three integer values namely i, j and my_input Step 3 - Read the required values from the user/ define the values Step 4 - We iterate through two ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
4K+ Views
In this article, we will understand how to print hollow right triangle star pattern. The pattern is formed by using multiple for-loops and print statements. For the pyramid at the first line it will print one star, and at the last line it will print n number of stars. For other lines it will print exactly two stars at the start and end of the line, and there will be some blank spaces between these two starts.Below is a demonstration of the same −InputSuppose our input is −Enter the size : 8OutputThe desired output would be −The hollow pyramid triangle ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
1K+ Views
In this article, we will understand how to print inverted star pattern. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the size : 8OutputThe desired output would be −The inverted star pattern *************** ************* *********** ********* ******* ***** *** *AlgorithmStep 1 - START Step 2 - Declare four integer values namely i, j, k and my_input. Step 3 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
615 Views
In this article, we will understand how to print 8-star pattern. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the number : 8OutputThe desired output would be −The 8 pattern : ****** * * * * * * * * * * * * ****** * * * * * * * * * * * ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
466 Views
If someone wants to build a strong foundation in Java programming language. Then, it is necessary to understand the working of loops. Also, solving the pyramid pattern problems is the best way to enhance the fundamentals of Java as it includes extensive use of the for and while loops. This article aims to provide a few Java programs to print pyramid patterns with the help of different types of loops available in Java. Java Program to Create Pyramid Patterns We are going to print the following Pyramid Patterns through Java programs − Inverted Star Pyramid Star Pyramid Numeric Pyramid ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
843 Views
In this article, we will understand how to print spiral pattern of numbers. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the size : 5OutputThe desired output would be −The spiral pattern 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 5 5 4 3 3 3 3 3 4 5 5 3 2 2 4 2 3 4 5 5 4 3 2 1 2 3 4 5 5 4 3 2 2 2 3 4 5 ... Read More