Need help with Java code!

My homework assignment is to make a program that returns a shape like below if you enter a number ( I think it's 3 ). I'm really new at Java and am not sure how so if someone could help me it would be awesome.

public String addNewRow(String s) { //adds the new row escape sequence to the end of string s. s+="\n";

return s; }

public String appendSymbol(String a, int n, String s) { //appends string a x n times to string s (it adds a to the end of s) /* if a is errorneous, then s becomes null, if s is null the loop does not start and s is set to "" and returned. (empty string, not null!) */ if(a==null) s=null; //if a is a empty string, then nothing will happen, //so does not need to check that. if(s!=null) { for(int i=0; i<n; i++) { s+=a; } } else s="";

return s; }

public String appendSymbol(String a, String s) { //if you give only two strings it will do the above with n as 1. //Can't remember the term for this specific technique. if(a==null) s=null; if(s!=null) { s+=a; } else s="";

return s; }}

Wow! You explained it and everything! In the process of getting Java to try it out. Thanks!