Help needed regarding "recursive method execution"
843789Aug 18 2010 — edited Aug 20 2010Hi everybody,m a beginner ,while trying to execute the following code in the output i can't getthe symbol ( ' ) correctly printed ,plz lemme know where m i at fault-
class Song{
public static void lyrics(int n){
if(n==1){
System.out.println("No bottles of beer on the wall,; no bottles of beer, ya' can?t take one down,ya' can?t pass it around, 'cause there are no more bottles of beer");
}
else{
System.out.println(n+" bottles of beer on the wall," + n + "bottles of beer, ya? take one down, ya?pass it around," + (n-1)+" bottles of beer on the wall.");
lyrics(n-1);
}
}
public static void main(String[] args)
{
lyrics(3);
}
}
Edited by: basant1988 on Aug 18, 2010 2:26 AM
Edited by: basant1988 on Aug 18, 2010 2:37 AM