public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here String str = "Yellow Fever"; for (int i=0; i<=str.length(); i++) System.out.println(str.substring(0,i)); } }