How to print the following pattern in java?
he he is he is going he is going in
import java.io.*; class StringPattern { public static void main(String[] args) throws IOException{ String st="he is going in"; String str[]=st.split(" "); for(byte i=0;i<str.length;i++) { System.out.println(); for(byte j=0;j<=i;j++) System.out.print(str[j]+" "); } } }