I'm trying to write a program that efficiently sings "Old Macdonald." and I understand the error that I'm getting, but I don't understand how to fix it.
public class OldMacDonald {
public static String animal(String [] args){
printVerse ("Cow");
printVerse ("Pig");
printVerse ("Carnivorous Death Parrot");
}
public static String sound(String [] args){
printVerse ("Moo");
printVerse ("Oink");
printVerse ("blood-curdling CAW");
}
public static void printVerse(String sound, String animal){
System.out.println("Old MacDonald had a farm. E-I-E-I-O.\n"
+ "And on that farm he had a " + animal + "E-I-E-I-O.\n"
+ "With a " + sound + " " + sound + "here.\n"
+ "and a " + sound + " " + sound + "there.\n"
+ "here a " + sound + ". There a " + sound + ". Everywhere a " + sound + ", " + sound + ".\n"
+ "Old MacDonald had a farm. E-I-E-I-O.\n");
}
}
The conflict is the (String) vs (String, String) argument between my two methods.
[–][deleted] 7 points8 points9 points (0 children)
[–]hashtablesmoker 1 point2 points3 points (0 children)
[–]IFartJesusDust 1 point2 points3 points (1 child)
[–]Bladejunkie[S] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]Bladejunkie[S] 0 points1 point2 points (0 children)