Alternating Strings *-*-*-*-
String s1 = new String();
String s2 = new String(“*”);
String s3 = new String(“-”);
int count = 0 ;
while (count < 10)
{
if ((count % 2) == 0)
S1 = new String(s1 + s2);
else
S1 = new String(s1 + s3);
Count++;
}
Previous slide
Next slide
Back to first slide
View graphic version