// Project: StaticMethods // No modules defined. // Source code file: Acrostic.java. // An acrostic is a poem arranged so that the first letters // of each line have a meaning. Given an input array of strings // that represent the lines of a poem, return the string composed // of the first concatenated letters of the lines of the poem. public class Acrostic { public static void main(String[] args) { String[ ] in = {"After an extensive winter", "Pretty tulips", "Rise from the once", "Icy ground bringing fresh signs of", "Life."}; String answer = acrostic(in); System.out.print(answer); } // Concatenate first characters of each string in array. public static String acrostic(String[ ] input) { String output = ""; for(String line : input) { output += line.charAt(0); } return output; } }