I need your help! This is a java program about "Method" ,and i want to make a triangle pattern. Please have a look.Thank you!
import java.util.Scanner; public class gh{ public static void goodboy(char c,int i){ while(i-- >0); System.out.print(c); } public static void main(String[]args){ Scanner input=new Scanner(System.in); System.out.println("Let us display the level of the triangle!"); System.out.println(); System.out.println("What is the level of triangle?"); System.out.println(); System.out.print("n="); int n=input.nextInt(); System.out.println("The level of triangle : "+n); System.out.println(); for(int i=1;n>=i;i++){ goodboy(' ',n-1); goodboy('*',(i*2)-1); System.out.println(); } } } I want to make a triangle pattern by using "Method" in java. Like this one👇👇👇👇👇 * *** ***** *******