Java Program to Print Downward Triangle Star Pattern Last Updated : 29 Dec, 2022 Comments Improve Suggest changes 3 Likes Like Report Downward triangle star pattern means we want to print a triangle that is downward facing means base is upwards and by default, orientation is leftwards so the desired triangle to be printed should look like * * * * * * * * * * Example Java // Java Program to Print Lower Star Triangle Pattern // Main class public class GFG { // Main driver method public static void main(String[] args) { // Nested 2 for loops for iteration over the matrix // Outer loop for rows int rows = 9; for (int a = rows - 1; a >= 0; a--) { // Inner loop for columns for (int b = 0; b <= a; b++) { // Prints star and space System.out.print("*" + " "); } // By now we are done with single row so new // line System.out.println(); } } } Output* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Using Recursion Java // added by Manish Sharma import java.io.*; class GFG { public static void printRow(int n) { if(n == 0) // base case { return; } System.out.print("* "); printRow(n - 1); // next * in the same row } public static void nextRow(int n) { if(n == 0) { return; } printRow(n); // prints the whole row recursively. System.out.print("\n"); // for new line after printing a row... nextRow(n - 1); // changed to new row } public static void main (String[] args) { GFG.nextRow(5); // no need to create an object of GFG class as nextRow method is static. } } Output* * * * * * * * * * * * * * * Time Complexity: O(n2), where n represents the given number of rows.Auxiliary Space: O(1), no extra space is required, so it is a constant. Comment D ddeevviissaavviittaa Follow 3 Improve D ddeevviissaavviittaa Follow 3 Improve Article Tags : Java Java Programs java-basics Explore Java BasicsIntroduction to Java3 min readJava Programming Basics9 min readJava Methods6 min readAccess Modifiers in Java4 min readArrays in Java7 min readJava Strings8 min readRegular Expressions in Java3 min readOOP & InterfacesClasses and Objects in Java9 min readAccess Modifiers in Java4 min readJava Constructors4 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages7 min readJava Interface7 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java4 min readIterator in Java5 min readJava Comparator Interface6 min readException HandlingJava Exception Handling6 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java10 min readFile Handling in Java4 min readJava Method References9 min readJava 8 Stream Tutorial7 min readJava Networking6 min readJDBC Tutorial5 min readJava Memory Management4 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers15+ min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz1 min readJava Project Ideas For Beginners and Advanced15+ min read Like