How to make a groundbreaking diamond using Java for statement wwww

public class sample {
	public static void main(String args[]){
		int i;


		for(i=0; i<5; i++){
			switch (i) {
			case 0:
				System.out.println("  *  ");
				break;
			case 1:
				System.out.println(" *** ");
				break;
			case 2:
				System.out.println("***** ");
				break;
			case 3:
				System.out.println(" *** ");
				break;
			case 4:
				System.out.println("  *  ");
				break;
			default:
				break;
			}
		}


	}
}

We are looking for formulas that can be calculated as 1,3,5,3,1 using two variables.

Recommended Posts

How to make a groundbreaking diamond using Java for statement wwww
How to make a Java container
How to make a Java array
How to output array values without using a for statement
How to make a Java calendar Summary
How to make a Discord bot (Java)
How to make a hinadan for a Spring Boot project using SPRING INITIALIZR
How to make a lightweight JRE for distribution
[Java] How to make multiple for loops single
Java --How to make JTable
[Java] How to get HashMap elements by loop control using extended for statement
How to convert A to a and a to A using AND and OR in Java
How to make a mod for Slay the Spire
How to loop Java Map (for Each / extended for statement)
How to create a lightweight container image for Java apps
How to make a JDBC driver
[Java] How to create a folder
How to make a splash screen
How to make a Jenkins plugin
How to make a Maven project
How to get the contents of Map using for statement Memorandum
How to check for the contents of a java fixed-length string
How to sort a List using Comparator
[Java] How to calculate age using LocalDate
[Introduction to Java] How to write a Java program
How to create a Maven repository for 2020
How to print a Java Word document
How to make asynchronous pagenations using Kaminari
How to build a Ruby on Rails environment using Docker (for Docker beginners)
Java beginner tried to make a simple web application using Spring Boot
I tried to make a talk application in Java using AI "A3RT"
[Java] [For beginners] How to insert elements directly in a 2D array
How to make an app with a plugin mechanism [C # and Java]
[JDBC] I tried to make SQLite3 database access from Java into a method for each SQL statement.
Java for statement
[Java] How to test for null with JUnit
How to create a database for H2 Database anywhere
[Rails] How to create a graph using lazy_high_charts
How to display a web page in Java
I did Java to make (a == 1 && a == 2 && a == 3) always true
How to delete a controller etc. using a command
I wanted to make (a == 1 && a == 2 && a == 3) true in Java
How to convert a solidity contract to a Java contract class
[Java] (for MacOS) How to set the classpath
Try to make a music player using Basic Player
How to make a follow function in Rails
[Java] How to operate List using Stream API
How to make a judgment method to search for an arbitrary character in an array
[Java] for statement, while statement
(Java) How to implement equals () for a class with value elements added by inheritance
[Java] [SQL Server] Connect to local SQL Server 2017 using JDBC for SQL Server
How to make a factory with a model with polymorphic association
How to create a Java environment in just 3 seconds
[Rails] How to create a signed URL for CloudFront
How to use an array for a TreeMap key
How to jump from Eclipse Java to a SQL file
How to write a unit test for Spring Boot 2
How to make an oleore generator using swagger codegen
java: How to write a generic type list [Note]
[Java] How to play rock-paper-scissors (equivalent to paiza rank A)
How to make Java unit tests (JUnit & Mockito & PowerMock)