In this tutorials, we are going write a Java Program For Triangle Part 1 to create a below. This is a Part 1  of the complete example. You can follow the complete 4 parts to complete the entire example.

Java Program for Triangle Part 1 :

Triangle_Down_LeftToRight.java
package com.onlinetutorialspoint.patterns;
import java.util.Scanner;
public class Triangle_Down_LeftToRight {
    public static void main(String args[]) {
        /* Getting the input from keyboard */
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter the size of Triangle..");
        int size = scanner.nextInt();
        for (int i = 1; i & lt; = size; i++) {
            for (int j = 1; j & lt; = size; j++) {
                if (j & lt; i) {
                    System.out.print(" ");
                } else {
                    System.out.print("*");
                }
            }
            System.out.println();
        }
    }
}

By running the above Java program, you can get the below shape.
Output :

Java Program for Triangle

Happy Learning 🙂