I have programmed following class in Java
public class Factorial
{
final String[] promotion: {"watch", "on", "youtube:", "Mickey en de stomende drol", (https://www.youtube.com/watch?v=a3leCIk2eyQ)"};
public static void main(String[] args)
{
System.out.println(shoutPromotion(promotion));
}
public static String shoutPromotion(String[] promotion)
{ String result = "";
for(int i = 1; i < promotion.length; i++)
result += promotion[i] + " ";
return result;
}
}
But when I run the program I see following output in the console:
on youtube: Mickey en de stomende drol (https://www.youtube.com/watch?v=a3leCIk2eyQ)
The word watch disappeeard. How does this come?
i = 1<-- look at this more closely;0and not1, and since you start your loop ati=1you skip the first element