Skip to main content
1 of 6
  1. if(strTemp.length() > maxWordLen)
       maxWordLen = strTemp.length();
    

This could be reduced to:

maxWordLen = Math.max(maxWordLen,strTemp.length());
  1. Inline the incrementation:

    charArr[i][j++] = ch;

3 . Either inline the output:

System.out.print((i != 0 ? " " : "") + charArr[i][j]);

or at least place braces:

if (i!=0){
   System.out.print(" ");
}