Lecture Notes on 25 July 2014 public class SubStr { public static void substr (String st) { int wnd = st.length(); while (wnd > 0) { int index = 0; while ((index + wnd) <= st.length()) { System.out.println (st.substring (index, index + wnd)); index++; } wnd--; } } public static void main (String[] args) { substr ("ABCD"); } }