import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    public static void startriangle(int n){
        for (int i = n; i > 0; i--){
            System.out.println(" ".repeat(i) + "*".repeat(n+1-i));
        }
    }
    public static void main(String[] args) {
        startriangle(4);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: