how to draw triangle in java

Solutions on MaxInterview for how to draw triangle in java by the best coders in the world

showing results for - "how to draw triangle in java"
Ilyess
23 Jun 2020
1public static void main(String[] args) {
2/*
3         *
4         * *
5         * * *
6         * * * *
7         * * * * *
8         * * * * * *
9         * * * * * * *   */
10
11     int z = 1;
12     while (z<=7){ // z value repeat
13
14         int i = 1;
15         while (i <= z){
16             System.out.print("* ");
17             i++;
18         }
19             System.out.println();
20             z++;
21     }
22        System.out.println("==============");
23
24        int z2 = 7;
25        while (z2 >= 1){ // z value repeat
26
27            int i2 = 1;
28            while (i2 <= z2){
29                System.out.print("* ");
30                i2++;
31            }
32
33            System.out.println();
34            z2--;
35        }
36
Valentina
07 Oct 2020
1graphics.drawPolygon(new int[] {10, 20, 30}, new int[] {100, 20, 100}, 3);
2// Graphics.drawPolygon(x-coordinates, y-coordinates, # of points);
queries leading to this page
triangle javahow to draw a triangle in javascode for drawing a triangle using in javahow to draw triangle java swinghow to draw a triangle in java with stddraw triangle javatriangle java 5cjava graphics trianglejava graphics draw triangletriangle constructor javatriangle in javadraw triangle in javajava designing a trianglehow to make a triangle pattern in javatriangle code in javahow to create triangle in javatriangle graphics javadraw a polydon triangle in javatriangle java swingjava draw a triangledraw a triangle in javajava triangle formulatriangle class in java 22triangle java 22java triangle functionhow to make the triangle in javajava draw triangle shapetriangle javatriangle formed in javadraw triabgle in javamake triangle javafor triangle program for javadraw triangle in java awttriangle area in javadraw triangle jfram javatriangle type program in javadraw triangle javahow to draw a triangle javahow to make a triangle with point javadraw triangle java awttriangle java awtbuild triangle java functionhow to code a triangle in java 5cdrawing triangle starts java 7ejava triangle examplehow to draw triangle javajava trianglehow to draw a triangle in java swingtriangle program in javacode for drawing a triangle using in java using drawtriangle methoddraw triangle in triangle by java graphicshow to draw a triangle in java graphicsjava custom draw triangle 22triangle java 22 shape javajava draw trianglehow to draw triangle in java 24 triangle in java 23 2a triangle in javahow to create a triangle in javahow to create a right triangle javajava 2a triangle formulahow to make a triangle with points javahow to draw a triangle in javapoint in triangle javahow to code a triangle in javahow to make a triangle javahow to make triangle in javajava triangle codetriangle formula in javajava gui application that draws triangle 2a triangle in javahow to make a triangle in javahow to draw triangle in java