Optimize solution of pattern program 1



	import java.io.*
	public class loop {
		public static void main(String args[]) {
			String ss = "";
			Console con = System.console();
			int num = Integer.parseInt(con.readLine());
			for(int i = 0;i<num;i ++) {
				ss+="* ";
				System.out.println(ss);
			}
		}
	}

Comments