Question #265007

Write a java program that would display the 8 shape using the ‘*’ characte


Expert's answer


SOLUTION TO THE ABOVE QUESTION


SOLUTION CODE


package com.company;

public class Main {

    public static void main(String[] args) {
   // write your code here

        System.out.println(" * * *");
        System.out.println("*     *");
        System.out.println("*     *");
        System.out.println(" *   *  ");
        System.out.println("   *  ");
        System.out.println(" *   *  ");
        System.out.println("*     *");
        System.out.println("*     *");
        System.out.println(" * * *");

    }
}


SAMPLE PROGRAM OUTPUT



LATEST TUTORIALS
APPROVED BY CLIENTS