I'm working on making java code produce an output for lyrics on a song, but am confused on how to incorporate method calling to save on repeated verses. I can use the println statement for each line, but the teacher wants method calling as well. Hope someone can help out, thanks!
So the code looks something like this: public class lyrics { public static void main(String[] args) { System.out.println("blah blah blah"); System.out.println("blah blah blah"); System.out.println("blah blah blah"); System.out.println("");//new line System.out.println("blah blah blah");//repeated verse System.out.println("blah blah blah");//repeated verse System.out.println("blah blah blah");//repeated verse System.out.println("");//new line System.out.println("blah blah blah"); System.out.println("blah blah blah"); System.out.println("blah blah blah"); System.out.println("");//new line System.out.println("blah blah blah");//repeated verse System.out.println("blah blah blah");//repeated verse System.out.println("blah blah blah");//repeated verse } }
How can I have the parts where the verses repeated do a "method call"?
Join our real-time social learning platform and learn together with your friends!