Object-Oriented Programming with Java, part I – Exercise 3

Create a program that prints the following:

    *    
***
*****
*******
*********
*

public class Spruce {

    public static void main(String[] args) {

        // Write code here
        System.out.println("    *");
        System.out.println("   ***");
        System.out.println("  *****");
        System.out.println(" *******");
        System.out.println("*********");
        System.out.println("    *");
    }

}

Leave a comment